1 && $this->where('first_user_id|second_user_id|third_user_id', '=', $user_id); $is_settled > -1 && $this->where('is_settled', '=', !!$is_settled); !empty($search) && $this->where('user.nickName', 'like', "%{$search}%"); // 获取分销商订单列表 $data = $this->with([ 'dealer_first.user', 'dealer_second.user', 'dealer_third.user' ]) ->order(['create_time' => 'desc']) ->paginate(10, false, [ 'query' => \request()->request() ]); if ($data->isEmpty()) { return $data; } // 获取订单的主信息 $with = ['goods' => ['image', 'refund'], 'address', 'user']; return OrderService::getOrderList($data, 'order_master', $with); } }