fix carbon addDays

This commit is contained in:
xiaomlove
2025-05-02 21:21:37 +07:00
parent 6a3ed230df
commit 8f4a6cf50c
5 changed files with 9 additions and 9 deletions

View File

@@ -70,7 +70,7 @@ class MedalRepository extends BaseRepository
}
$expireAt = null;
if ($duration > 0) {
$expireAt = Carbon::now()->addDays($duration)->toDateTimeString();
$expireAt = Carbon::now()->addDays(intval($duration))->toDateTimeString();
}
clear_user_cache($uid);
return $user->medals()->attach([$medal->id => ['expire_at' => $expireAt, 'status' => UserMedal::STATUS_NOT_WEARING]]);