diff --git a/app/Repositories/UserRepository.php b/app/Repositories/UserRepository.php index 486e99f4..dc8670ea 100644 --- a/app/Repositories/UserRepository.php +++ b/app/Repositories/UserRepository.php @@ -504,6 +504,9 @@ class UserRepository extends BaseRepository $log .= ", meta exists"; $keyExistsUpdates['updated_at'] = now(); if (!empty($keyExistsUpdates['duration'])) { + if ($metaExists->deadline === null) { + throw new \RuntimeException(nexus_trans('user.metas.already_valid_forever', ['meta_key_text' => $metaExists->metaKeyText])); + } $log .= ", has duration: {$keyExistsUpdates['duration']}"; if ($metaExists->deadline && $metaExists->deadline->gte(now())) { $log .= ", not expire"; diff --git a/include/constants.php b/include/constants.php index 0ac71742..06ba65bf 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,6 +1,6 @@ '修改用户名一次,永久有效。', 'text_success_buy_change_username_card' => "祝贺你,成功购买了改名卡!", 'text_change_username_card_already_has' => '已经拥有改名卡', + 'text_rainbow_id_already_valid_forever' => '已永久拥有彩虹 ID', ); ?> diff --git a/lang/cht/lang_mybonus.php b/lang/cht/lang_mybonus.php index 31c21b23..463564fa 100644 --- a/lang/cht/lang_mybonus.php +++ b/lang/cht/lang_mybonus.php @@ -166,6 +166,7 @@ $lang_mybonus = array 'text_buy_change_username_card_note' => '修改用戶名一次,永久有效。', 'text_success_buy_change_username_card' => "祝賀你,成功購買了改名卡!", 'text_change_username_card_already_has' => '已經擁有改名卡', + 'text_rainbow_id_already_valid_forever' => '已永久擁有彩虹 ID', ); ?> diff --git a/lang/en/lang_mybonus.php b/lang/en/lang_mybonus.php index afc040f1..c07236cf 100644 --- a/lang/en/lang_mybonus.php +++ b/lang/en/lang_mybonus.php @@ -166,6 +166,7 @@ where