|
|
@@ -74,13 +74,23 @@ class BackflowService extends BaseService
|
|
|
{
|
|
|
$date = Carbon::now('Asia/Shanghai')->format('Y-m');
|
|
|
$limit = isset($search['limit']) ? $search['limit'] : 15;
|
|
|
- $paginator = self::$MODEL::where(self::getWhere($search))
|
|
|
+ $query = self::$MODEL::where(self::getWhere($search))
|
|
|
|
|
|
// ->where('date', '<', $date)
|
|
|
->with(['member'])
|
|
|
->orderByDesc('date')
|
|
|
- ->orderBy('status')
|
|
|
- ->paginate($limit);
|
|
|
+ ->orderBy('status');
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (isset($search['username']) && !empty($search['username'])) {
|
|
|
+ $username = $search['username'];
|
|
|
+ $query = $query->whereHas('member', function ($query) use ($username) {
|
|
|
+ $query->where('username', $username);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ $paginator =$query->paginate($limit);
|
|
|
return ['total' => $paginator->total(), 'data' => $paginator->items()];
|
|
|
}
|
|
|
}
|