|
@@ -67,8 +67,13 @@ class User extends Controller
|
|
|
'like_first_name' => ['nullable', 'string', 'min:1'],
|
|
'like_first_name' => ['nullable', 'string', 'min:1'],
|
|
|
'username' => ['nullable', 'string', 'min:1'],
|
|
'username' => ['nullable', 'string', 'min:1'],
|
|
|
'register_ip' => ['nullable', 'string', 'min:1'],
|
|
'register_ip' => ['nullable', 'string', 'min:1'],
|
|
|
|
|
+ 'order' => ["nullable", 'string', "in:asc,desc"],
|
|
|
|
|
+ 'by' => ['nullable', 'string', "in:available_balance,created_at"],
|
|
|
]);
|
|
]);
|
|
|
- $result = UserService::paginate($search);
|
|
|
|
|
|
|
+ $order = request()->input('order', 'created_at');
|
|
|
|
|
+ $by = request()->input('by', 'desc');
|
|
|
|
|
+
|
|
|
|
|
+ $result = UserService::paginate($search,$order,$by);
|
|
|
} catch (ValidationException $e) {
|
|
} catch (ValidationException $e) {
|
|
|
return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
|
|
return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
|
|
|
} catch (Exception $e) {
|
|
} catch (Exception $e) {
|