diff --git a/locale/zh-Hans.yml b/locale/zh-Hans.yml index b8034e7..7c196fd 100755 --- a/locale/zh-Hans.yml +++ b/locale/zh-Hans.yml @@ -14,7 +14,7 @@ mattoid-daily-check-in-history: max-supplementary-checkin: 最大连续补签数 max-supplementary-checkin-requirement: 允许签到最大连续补签的天数,若中间有已签到的日期则重新计算连续补签天数 span-day-checkin: 允许跨天补签 - span-day-checkin-requirement: 开启后,补签日期之后不允许有未签到的日期数据 + span-day-checkin-requirement: 开启后,补签日期之后允许有未签到的日期数据 allow-supplementary-check-in: 允许补签 issuance-of-supplementary-cards: 发放补签卡 complimentary-supplementary-card: 赠送补签卡 diff --git a/src/Api/Controller/PostCheckinHistoryController.php b/src/Api/Controller/PostCheckinHistoryController.php index 0b03dfd..c4107ce 100644 --- a/src/Api/Controller/PostCheckinHistoryController.php +++ b/src/Api/Controller/PostCheckinHistoryController.php @@ -56,7 +56,6 @@ public function __construct(SettingsRepositoryInterface $settings, Dispatcher $e */ protected function data(ServerRequestInterface $request, Document $document) { - $actor = RequestUtil::getActor($request); $userId = Arr::get($actor, 'id'); $checkinDate = Arr::get($request->getParsedBody(), 'date'); @@ -134,7 +133,7 @@ protected function data(ServerRequestInterface $request, Document $document) // 需要确认是连续签到,并且补签的前一天和后一天都没有漏签 $tomorrow = date('Y-m-d',strtotime("1 days",strtotime($checkinDate))); $signedinCount = UserCheckinHistory::query()->where('user_id', $userId)->where('last_checkin_date', '>=', $tomorrow)->count(); - if (isset($spanDayCheckin) && !$spanDayCheckin && empty($signedinCount)) { + if (isset($spanDayCheckin) && !$spanDayCheckin && $signedinCount < $diffDay) { throw new ValidationException(['message' => $this->translator->trans('mattoid-daily-check-in-history.api.error.span-day-checkin', ['date' => $checkinDate])]); } $yesterday = date('Y-m-d',strtotime("-1 days",strtotime($checkinDate))); @@ -162,10 +161,7 @@ protected function data(ServerRequestInterface $request, Document $document) $supplementaryCheckinCount ++; } - - $history = $this->events->dispatch(new SupplementaryCheckinEvent($actor, $checkinDate, $totalContinuousCheckinCountHistory, $supplementaryCheckinCount)); - - return $history; + return reset($history); } }