From a47d2fe901f340d9a1c1a5a2ed097e88e2a45eec Mon Sep 17 00:00:00 2001 From: liufei Date: Wed, 31 Jul 2024 15:08:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E8=A1=A5=E7=AD=BE?= =?UTF-8?q?=E4=B8=8D=E4=BC=9A=E7=B4=AF=E8=AE=A1=E4=BB=A5=E5=89=8D=E7=9A=84?= =?UTF-8?q?=E7=AD=BE=E5=88=B0=E5=A4=A9=E6=95=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Api/Controller/PostCheckinHistoryController.php | 3 ++- src/Api/Controller/PostGiveCheckinCardController.php | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Api/Controller/PostCheckinHistoryController.php b/src/Api/Controller/PostCheckinHistoryController.php index 6c00593..0b03dfd 100644 --- a/src/Api/Controller/PostCheckinHistoryController.php +++ b/src/Api/Controller/PostCheckinHistoryController.php @@ -11,6 +11,7 @@ namespace Mattoid\CheckinHistory\Api\Controller; +use Carbon\Carbon; use DateTime; use Flarum\Api\Controller\AbstractCreateController; use Flarum\Foundation\ValidationException; @@ -132,7 +133,7 @@ protected function data(ServerRequestInterface $request, Document $document) $totalContinuousCheckinCountHistory = 0; // 需要确认是连续签到,并且补签的前一天和后一天都没有漏签 $tomorrow = date('Y-m-d',strtotime("1 days",strtotime($checkinDate))); - $signedinCount = UserCheckinHistory::query()->where('user_id', $userId)->where('last_checkin_date', $tomorrow)->count(); + $signedinCount = UserCheckinHistory::query()->where('user_id', $userId)->where('last_checkin_date', '>=', $tomorrow)->count(); if (isset($spanDayCheckin) && !$spanDayCheckin && empty($signedinCount)) { throw new ValidationException(['message' => $this->translator->trans('mattoid-daily-check-in-history.api.error.span-day-checkin', ['date' => $checkinDate])]); } diff --git a/src/Api/Controller/PostGiveCheckinCardController.php b/src/Api/Controller/PostGiveCheckinCardController.php index 97e7c9d..66f46db 100644 --- a/src/Api/Controller/PostGiveCheckinCardController.php +++ b/src/Api/Controller/PostGiveCheckinCardController.php @@ -56,8 +56,6 @@ public function __construct(SettingsRepositoryInterface $settings, Dispatcher $e */ protected function data(ServerRequestInterface $request, Document $document) { - - app("log")->info(json_encode($request->getParsedBody())); $actor = RequestUtil::getActor($request); $userId = Arr::get($actor, 'id'); $username = Arr::get($request->getParsedBody(), 'username');