Skip to content

Commit

Permalink
Merge pull request #242 from nightcp/fix-report-sign-repeat
Browse files Browse the repository at this point in the history
  • Loading branch information
kuaifan authored Jan 4, 2025
2 parents 30b9276 + 073d03a commit 1cb0cdf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Models/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@ public static function generateSign($type, $offset, Carbon $time = null): string
// 如果设置了周期偏移量
empty( $offset ) || $now_dt->subWeeks( abs( $offset ) );
$now_dt->startOfWeek(); // 设置为当周第一天
return $now_dt->year . $now_dt->weekOfYear;
return now()->year . $now_dt->weekOfYear;
},
Report::DAILY => function() use ($now_dt, $offset) {
// 如果设置了周期偏移量
empty( $offset ) || $now_dt->subDays( abs( $offset ) );
return $now_dt->format("Ymd");
return now()->format("Ymd");
},
default => "",
};
Expand Down

0 comments on commit 1cb0cdf

Please sign in to comment.