|
|
@@ -101,8 +101,9 @@ class UserService extends BaseService
|
|
|
public static function paginate(array $search = [])
|
|
|
{
|
|
|
$limit = isset($search['limit']) ? $search['limit'] : 15;
|
|
|
- $paginator = static::$MODEL::where(self::getWhere($search))->with(['wallet'])
|
|
|
+ $paginator = static::$MODEL::with(['wallet'])
|
|
|
->join('wallets', 'users.member_id', '=', 'wallets.member_id')
|
|
|
+ ->where(self::getWhere($search))
|
|
|
->orderByDesc('created_at')->paginate($limit);
|
|
|
return ['total' => $paginator->total(), 'data' => $paginator->items()];
|
|
|
}
|