分销订单带关键字

pull/1/head
674780036@qq.com 11 months ago
parent 8f90a6251e
commit 879a03e5a2
  1. 16
      app/api/model/dealer/Order.php

@ -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);

Loading…
Cancel
Save