|
|
@@ -14,20 +14,29 @@ class Bet extends Controller
|
|
|
/**
|
|
|
* @description: 分页数据
|
|
|
* @return {*}
|
|
|
+ *
|
|
|
+ * @apiParam {String} [start_time] 开始时间
|
|
|
+ * - 格式:`yyyy-mm-dd`
|
|
|
+ * @apiParam {String} [end_time] 截止时间
|
|
|
+ * - 格式:`yyyy-mm-dd`
|
|
|
*/
|
|
|
function index()
|
|
|
{
|
|
|
try {
|
|
|
- request()->validate([
|
|
|
- 'issue_no' => ['nullable', 'string'],
|
|
|
+ $params = request()->validate([
|
|
|
+ 'page' => ['nullable', 'integer', 'min:1'],
|
|
|
+ 'limit' => ['nullable', 'integer', 'min:1'],
|
|
|
'member_id' => ['nullable', 'string'],
|
|
|
+ 'keywords' => ['nullable', 'string', 'min:1'],
|
|
|
+ 'issue_no' => ['nullable', 'string'],
|
|
|
'id' => ['nullable', 'string'],
|
|
|
'status' => ['nullable', 'integer', 'in:1,2'],
|
|
|
- 'keywords' => ['nullable', 'string', 'min:1'],
|
|
|
'username' => ['nullable', 'string', 'min:1'],
|
|
|
+ 'start_time' => ['nullable', 'date', 'date_format:Y-m-d', 'required_with:end_time'],
|
|
|
+ 'end_time' => ['nullable', 'date', 'date_format:Y-m-d', 'required_with:start_time'],
|
|
|
+
|
|
|
]);
|
|
|
- $search = request()->all();
|
|
|
- $result = BetService::paginate($search);
|
|
|
+ $result = BetService::paginate($params);
|
|
|
} catch (ValidationException $e) {
|
|
|
return $this->error(HttpStatus::VALIDATION_FAILED, $e->validator->errors()->first());
|
|
|
} catch (Exception $e) {
|