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
A is an intermediate variableTi is the i<
'text_buy_change_username_card_note' => 'Change your username once and it will be valid forever.',
'text_success_buy_change_username_card' => "Congratulations on your successful purchase of a change username card !",
'text_change_username_card_already_has' => 'Already have a change username card',
+ 'text_rainbow_id_already_valid_forever' => 'Already have a permanent Rainbow ID',
);
?>
diff --git a/public/mybonus.php b/public/mybonus.php
index 32be2174..ece8f1a0 100644
--- a/public/mybonus.php
+++ b/public/mybonus.php
@@ -436,6 +436,12 @@ for ($i=0; $i < count($allBonus); $i++)
} else {
print(" ");
}
+ } elseif ($bonusarray['art'] == 'rainbow_id') {
+ if (\App\Models\UserMeta::query()->where('uid', $CURUSER['id'])->where('meta_key', \App\Models\UserMeta::META_KEY_PERSONALIZED_USERNAME)->whereNull('deadline')->exists()) {
+ print(" ");
+ } else {
+ print(" ");
+ }
} else {
print(" ");
}
diff --git a/resources/lang/en/user.php b/resources/lang/en/user.php
index 705a56dd..73227f5a 100644
--- a/resources/lang/en/user.php
+++ b/resources/lang/en/user.php
@@ -38,4 +38,7 @@ return [
'subject' => 'Get Props::name',
'body' => ':operator Grant you :name, Validity period: :duration.',
],
+ 'metas' => [
+ 'already_valid_forever' => ':meta_key_text 已經永久有效',
+ ],
];
diff --git a/resources/lang/zh_CN/user.php b/resources/lang/zh_CN/user.php
index 96d3647a..1d9b3b61 100644
--- a/resources/lang/zh_CN/user.php
+++ b/resources/lang/zh_CN/user.php
@@ -38,4 +38,7 @@ return [
'subject' => '获得道具::name',
'body' => ':operator 授予你 :name, 有效期::duration。',
],
+ 'metas' => [
+ 'already_valid_forever' => ':meta_key_text already valid forever',
+ ],
];
diff --git a/resources/lang/zh_TW/user.php b/resources/lang/zh_TW/user.php
index 8e8de316..a5414a4c 100644
--- a/resources/lang/zh_TW/user.php
+++ b/resources/lang/zh_TW/user.php
@@ -38,4 +38,7 @@ return [
'subject' => '獲得道具::name',
'body' => ':operator 授予你 :name, 有效期::duration。',
],
+ 'metas' => [
+ 'already_valid_forever' => ':meta_key_text 已經永久有效',
+ ],
];