setBaseQuery($this->alias, [ ['order', 'order_id'], ['user', 'user_id'], ]); // 检索查询条件 if (!empty($search)) { $this->where(function ($query) use ($search) { $query->whereOr('order.order_no', 'like', "%{$search}%") ->whereOr('user.nickName', 'like', "%{$search}%"); }); } // 返回列表数据 return $this->with(['user']) ->field(['wow_order.*', 'order.order_no', 'order.pay_price']) ->where("{$this->alias}.is_delete", '=', 0) ->order(["{$this->alias}.create_time" => 'desc']) ->paginate(15, false, [ 'query' => request()->request() ]); } }