|
|
@@ -72,8 +72,7 @@ class BackflowService extends BaseService
|
|
|
|
|
|
public static function paginate(array $search = []): array
|
|
|
{
|
|
|
- $page = request()->input('page', 1);
|
|
|
- $limit = request()->input('limit', 10);
|
|
|
+
|
|
|
$date = Carbon::now('Asia/Shanghai')->format('Y-m');
|
|
|
$query = static::$MODEL::where(static::getWhere($search))
|
|
|
->where('date', '<', $date);
|
|
|
@@ -85,7 +84,7 @@ class BackflowService extends BaseService
|
|
|
}
|
|
|
$count = $query->count();
|
|
|
$query->with(['user'])->orderByDesc('date')->orderBy('status');
|
|
|
- $list = $query->forPage($page, $limit)->get()->toArray();
|
|
|
+ $list = $query->forPage($search['page'], $search['limit'])->get()->toArray();
|
|
|
|
|
|
return ['total' => $count, 'data' => $list];
|
|
|
}
|