fix carbon 3 diffIn*

This commit is contained in:
xiaomlove
2025-01-19 23:41:50 +08:00
parent 943e960921
commit 9de6fb42a9
12 changed files with 20 additions and 21 deletions
+1 -1
View File
@@ -432,7 +432,7 @@ class UserRepository extends BaseRepository
$changeLog = $user->usernameChangeLogs()->orderBy('id', 'desc')->first();
if ($changeLog) {
$miniDays = Setting::get('system.change_username_min_interval_in_days', 365);
if ($changeLog->created_at->diffInDays() <= $miniDays) {
if (abs($changeLog->created_at->diffInDays()) <= $miniDays) {
$msg = nexus_trans('user.change_username_lte_min_interval', ['last_change_time' => $changeLog->created_at, 'interval' => $miniDays]);
throw new \RuntimeException($msg);
}