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');