订单获取接口,增加获取订单来源
This commit is contained in:
parent
ba0d6a527e
commit
d4d07fa9ba
@ -97,10 +97,10 @@ class StoreOrderDao extends BaseDao
|
||||
$query->whereIn('StoreOrder.status', [0, 9]);
|
||||
break;
|
||||
case -2 :
|
||||
$query->where('paid', 1)->whereNotIn('StoreOrder.status', [10, 11]);
|
||||
$query->where('StoreOrder.paid', 1)->whereNotIn('StoreOrder.status', [10, 11]);
|
||||
break;
|
||||
case 10 :
|
||||
$query->where('paid', 1)->whereIn('StoreOrder.status', [10, 11]);
|
||||
$query->where('StoreOrder.paid', 1)->whereIn('StoreOrder.status', [10, 11]);
|
||||
break;
|
||||
default:
|
||||
$query->where('StoreOrder.status', $where['status']);
|
||||
@ -108,7 +108,7 @@ class StoreOrderDao extends BaseDao
|
||||
}
|
||||
})
|
||||
->when(isset($where['uid']) && $where['uid'] !== '', function ($query) use ($where) {
|
||||
$query->where('uid', $where['uid']);
|
||||
$query->where('StoreOrder.uid', $where['uid']);
|
||||
})
|
||||
//待核销订单
|
||||
->when(isset($where['is_verify']) && $where['is_verify'], function ($query) use ($where) {
|
||||
@ -178,7 +178,8 @@ class StoreOrderDao extends BaseDao
|
||||
});
|
||||
})
|
||||
->when(isset($where['group_order_sn']) && $where['group_order_sn'] !== '', function ($query) use ($where) {
|
||||
$query->join('StoreGroupOrder GO','StoreOrder.group_order_id = GO.group_order_id')->where('group_order_sn',$where['group_order_sn']);
|
||||
$query->join('StoreGroupOrder GO','StoreOrder.group_order_id = GO.group_order_id')
|
||||
->where('group_order_sn',$where['group_order_sn']);
|
||||
})
|
||||
->when(isset($where['keywords']) && $where['keywords'] !== '', function ($query) use ($where) {
|
||||
$query->where(function ($query) use ($where) {
|
||||
|
@ -1575,10 +1575,17 @@ class StoreOrderRepository extends BaseRepository
|
||||
* @author xaboy
|
||||
* @day 2020/6/10
|
||||
*/
|
||||
public function getList(array $where, $page, $limit)
|
||||
public function getList(array $where, $page, $limit, $source = 2)
|
||||
{
|
||||
|
||||
// $query->where('source', $source);
|
||||
|
||||
$query = $this->dao->search($where)->where('StoreOrder.is_del', 0);
|
||||
$count = $query->count();
|
||||
|
||||
// 增加订单类型筛选 1 小组采购 2 普通商品
|
||||
$query->hasWhere('groupOrder', ['source' => $source]);
|
||||
|
||||
$list = $query->with([
|
||||
'orderProduct',
|
||||
'presellOrder',
|
||||
|
@ -147,9 +147,13 @@ class StoreOrder extends BaseController
|
||||
[$page, $limit] = $this->getPage();
|
||||
$where['status'] = $this->request->param('status');
|
||||
$where['search'] = $this->request->param('store_name');
|
||||
$source = $this->request->param('source');
|
||||
$source = !isset($source)?2:$source; // 默认来源为2 普通商品订单
|
||||
$where['uid'] = $this->request->uid();
|
||||
$where['paid'] = 1;
|
||||
return app('json')->success($this->repository->getList($where, $page, $limit));
|
||||
$where['source'] = $source;
|
||||
|
||||
return app('json')->success($this->repository->getList($where, $page, $limit, $source));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user