|
|
|
@ -47,10 +47,20 @@ class Order extends DealerOrderModel |
|
|
|
|
// 检索查询条件 |
|
|
|
|
$filter = $this->getFilter($param); |
|
|
|
|
// 获取分销商订单列表 |
|
|
|
|
$list = $this->getNewQuery() |
|
|
|
|
$query = $this->getNewQuery() |
|
|
|
|
->with(['user.avatar', 'order']) |
|
|
|
|
->where($filter) |
|
|
|
|
->where('first_user_id|second_user_id|third_user_id', '=', $userId) |
|
|
|
|
->where($filter); |
|
|
|
|
if((!empty($_GET['keyword'])) ){ |
|
|
|
|
$orders = OrderModel::where('order_no','LIKE','%'.$_GET['keyword'].'%') |
|
|
|
|
->field('*') |
|
|
|
|
->select() |
|
|
|
|
->toArray(); |
|
|
|
|
$order_ids =array_column($orders,'order_id'); |
|
|
|
|
$query = $query->whereIn('order_id',$order_ids); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$list = $query->where('first_user_id|second_user_id|third_user_id', '=', $userId) |
|
|
|
|
->where('is_invalid', '=', 0) |
|
|
|
|
->order(['create_time' => 'desc']) |
|
|
|
|
->paginate(15); |
|
|
|
|