input('date', date('Y-m-d')); $start = strtotime($date); $end = strtotime("+1 day", $start); $list = SportModel::where("game_time", ">=", $start) ->where("game_time", "<", $end)->get(); $count = SportModel::where("game_time", ">=", $start) ->where("game_time", "<", $end)->count(); return $this->success(['list' => $list, 'count' => $count]); } public function odds(): JsonResponse { try { request()->validate([ 'data_id' => ['required', 'string', 'min:1'], ]); $dataId = request()->input('data_id'); $res = FixtureService::odds($dataId); } catch (ValidationException $e) { return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first()); } catch (Exception $e) { return $this->error($e->getCode()); } return $this->success($res); } public function oddsLive(): JsonResponse { try { request()->validate([ 'data_id' => ['required', 'string', 'min:1'], ]); $dataId = request()->input('data_id'); $res = FixtureService::oddsLive($dataId); } catch (ValidationException $e) { return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first()); } catch (Exception $e) { return $this->error($e->getCode()); } return $this->success($res); } }