|
|
|
@ -34,7 +34,7 @@ class Order extends BaseController |
|
|
|
|
public function lst($id) |
|
|
|
|
{ |
|
|
|
|
[$page, $limit] = $this->getPage(); |
|
|
|
|
$where = $this->request->params(['date','order_sn','order_type','keywords','username','activity_type','group_order_sn','store_name']); |
|
|
|
|
$where = $this->request->params(['date', 'order_sn', 'order_type', 'keywords', 'username', 'activity_type', 'group_order_sn', 'store_name']); |
|
|
|
|
$where['reconciliation_type'] = $this->request->param('status', 1); |
|
|
|
|
$where['mer_id'] = $id; |
|
|
|
|
return app('json')->success($this->repository->adminMerGetList($where, $page, $limit)); |
|
|
|
@ -58,9 +58,10 @@ class Order extends BaseController |
|
|
|
|
|
|
|
|
|
public function title() |
|
|
|
|
{ |
|
|
|
|
$where = $this->request->params(['type', 'date', 'mer_id','keywords','status','username','order_sn','is_trader','activity_type']); |
|
|
|
|
$where = $this->request->params(['type', 'date', 'mer_id', 'keywords', 'status', 'username', 'order_sn', 'is_trader', 'activity_type']); |
|
|
|
|
return app('json')->success($this->repository->getStat($where, $where['status'])); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* TODO |
|
|
|
|
* @return mixed |
|
|
|
@ -70,14 +71,14 @@ class Order extends BaseController |
|
|
|
|
public function getAllList() |
|
|
|
|
{ |
|
|
|
|
[$page, $limit] = $this->getPage(); |
|
|
|
|
$where = $this->request->params(['type', 'date', 'mer_id','keywords','status','username','order_sn','is_trader','activity_type','group_order_sn','store_name']); |
|
|
|
|
$where = $this->request->params(['type', 'date', 'mer_id', 'keywords', 'status', 'username', 'order_sn', 'is_trader', 'activity_type', 'group_order_sn', 'store_name']); |
|
|
|
|
$data = $this->repository->adminGetList($where, $page, $limit); |
|
|
|
|
return app('json')->success($data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function takeTitle() |
|
|
|
|
{ |
|
|
|
|
$where = $this->request->params(['date','order_sn','keywords','username','is_trader']); |
|
|
|
|
$where = $this->request->params(['date', 'order_sn', 'keywords', 'username', 'is_trader']); |
|
|
|
|
$where['take_order'] = 1; |
|
|
|
|
$where['status'] = ''; |
|
|
|
|
$where['verify_date'] = $where['date']; |
|
|
|
@ -94,7 +95,7 @@ class Order extends BaseController |
|
|
|
|
public function getTakeList() |
|
|
|
|
{ |
|
|
|
|
[$page, $limit] = $this->getPage(); |
|
|
|
|
$where = $this->request->params(['date','order_sn','keywords','username','is_trader']); |
|
|
|
|
$where = $this->request->params(['date', 'order_sn', 'keywords', 'username', 'is_trader']); |
|
|
|
|
$where['take_order'] = 1; |
|
|
|
|
$where['status'] = ''; |
|
|
|
|
$where['verify_date'] = $where['date']; |
|
|
|
@ -110,7 +111,7 @@ class Order extends BaseController |
|
|
|
|
*/ |
|
|
|
|
public function chart() |
|
|
|
|
{ |
|
|
|
|
return app('json')->success($this->repository->OrderTitleNumber(null,null)); |
|
|
|
|
return app('json')->success($this->repository->OrderTitleNumber(null, null)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -121,7 +122,7 @@ class Order extends BaseController |
|
|
|
|
*/ |
|
|
|
|
public function takeChart() |
|
|
|
|
{ |
|
|
|
|
return app('json')->success($this->repository->OrderTitleNumber(null,1)); |
|
|
|
|
return app('json')->success($this->repository->OrderTitleNumber(null, 1)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -146,7 +147,7 @@ class Order extends BaseController |
|
|
|
|
public function status($id) |
|
|
|
|
{ |
|
|
|
|
[$page, $limit] = $this->getPage(); |
|
|
|
|
$where = $this->request->params(['date','user_type']); |
|
|
|
|
$where = $this->request->params(['date', 'user_type']); |
|
|
|
|
$where['id'] = $id; |
|
|
|
|
return app('json')->success($this->repository->getOrderStatus($where, $page, $limit)); |
|
|
|
|
} |
|
|
|
@ -162,7 +163,7 @@ class Order extends BaseController |
|
|
|
|
{ |
|
|
|
|
if (!$this->repository->getWhereCount(['order_id' => $id, 'delivery_type' => 1])) |
|
|
|
|
return app('json')->fail('订单信息或状态错误'); |
|
|
|
|
return app('json')->success($this->repository->express($id,null)); |
|
|
|
|
return app('json')->success($this->repository->express($id, null)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function reList($id) |
|
|
|
@ -179,8 +180,8 @@ class Order extends BaseController |
|
|
|
|
*/ |
|
|
|
|
public function excel() |
|
|
|
|
{ |
|
|
|
|
$where = $this->request->params(['type', 'date', 'mer_id','keywords','status','username','order_sn','take_order']); |
|
|
|
|
if($where['take_order']){ |
|
|
|
|
$where = $this->request->params(['type', 'date', 'mer_id', 'keywords', 'status', 'username', 'order_sn', 'take_order']); |
|
|
|
|
if ($where['take_order']) { |
|
|
|
|
$where['verify_date'] = $where['date']; |
|
|
|
|
unset($where['date']); |
|
|
|
|
} |
|
|
|
@ -201,4 +202,52 @@ class Order extends BaseController |
|
|
|
|
$data = $this->repository->childrenList($id, 0); |
|
|
|
|
return app('json')->success($data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//消费等级配置 |
|
|
|
|
public function getLevelList() |
|
|
|
|
{ |
|
|
|
|
$data = $this->repository->getAllLevel(); |
|
|
|
|
return app('json')->success($data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function getLevelDetail($id) |
|
|
|
|
{ |
|
|
|
|
$data = $this->repository->getLevelDetail($id); |
|
|
|
|
return app('json')->success($data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function getLevelDelete($id) |
|
|
|
|
{ |
|
|
|
|
$data = $this->repository->getLevelDelete($id); |
|
|
|
|
return app('json')->success('删除成功'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function getLevelAdd() |
|
|
|
|
{ |
|
|
|
|
$data = $this->request->params(['name', 'min_price', ['level', 1], 'pay_hp']); |
|
|
|
|
if (empty($data['min_price']) || empty($data['name']) || empty($data['pay_hp'])) { |
|
|
|
|
return app('json')->fail('数据缺失'); |
|
|
|
|
} |
|
|
|
|
if ($this->repository->getOrderLevel($data['level'])) { |
|
|
|
|
return app('json')->fail('该等级已存在'); |
|
|
|
|
} |
|
|
|
|
$this->repository->createOrderLevel($data); |
|
|
|
|
return app('json')->success('添加成功'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function getLevelEdit() |
|
|
|
|
{ |
|
|
|
|
$data = $this->request->params(['name', 'min_price', ['level', 1], 'pay_hp', 'id']); |
|
|
|
|
if (empty($data['min_price']) || empty($data['name']) || empty($data['pay_hp']) || empty($data['id'])) { |
|
|
|
|
return app('json')->fail('数据缺失'); |
|
|
|
|
} |
|
|
|
|
if (!$this->repository->getDetail($data['id'])) { |
|
|
|
|
return app('json')->fail('该数据不存在'); |
|
|
|
|
} |
|
|
|
|
if ($this->repository->getOrderLevel($data['level'],$data['id'])) { |
|
|
|
|
return app('json')->fail('该等级已存在'); |
|
|
|
|
} |
|
|
|
|
$this->repository->updateOrderLevel($data); |
|
|
|
|
return app('json')->success('编辑成功'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|