with(['image', 'dealer']) ->where($where) ->where('user_id', '=', $userId) ->where('is_delete', '=', 0) ->order(['create_time' => 'desc']) ->paginate($listRows); } /** * @notes:分销员订单列表 * @param $where * @param int $listRows * @return Paginator * @throws BaseException * @throws DbException * @author: wanghousheng */ public function dealerOrders($where, int $listRows = 15): Paginator { // 当前用户ID $userId = UserService::getCurrentLoginUserId(); // 查询列表数据 return $this->with(['image', 'user']) ->where($where) ->where('dealer_id', '=', $userId) ->where('is_delete', '=', 0) ->order(['create_time' => 'desc']) ->paginate($listRows); } }