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'], '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'], 'is_winner'=>['nullable','integer','in:0,1'], ]); $result = BetService::paginate($params); } catch (ValidationException $e) { return $this->error(HttpStatus::VALIDATION_FAILED, $e->validator->errors()->first()); } catch (Exception $e) { return $this->error(intval($e->getCode())); } return $this->success($result); } // 模拟下注 public function fake() { BetService::randomVirtualBetting(3); return $this->success(); } }