diff --git a/app/Console/Commands/Test.php b/app/Console/Commands/Test.php index 99b903d7..9bb3ea5d 100644 --- a/app/Console/Commands/Test.php +++ b/app/Console/Commands/Test.php @@ -95,7 +95,8 @@ class Test extends Command */ public function handle() { - + $r = NexusDB::cache_get('category_content'); + dd($r); } } diff --git a/include/constants.php b/include/constants.php index 2b9b8303..3bdf583d 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,6 +1,6 @@ get(['id']); + foreach ($searchBoxList as $item) { + \Nexus\Database\NexusDB::cache_del("category_list_mode_{$item->id}"); + } + } /** diff --git a/public/medal.php b/public/medal.php index 940677d7..ce5e17f4 100644 --- a/public/medal.php +++ b/public/medal.php @@ -1,7 +1,7 @@ where('get_type', \App\Models\Medal::GET_TYPE_EXCHANGE); +$query = \App\Models\Medal::query(); $q = htmlspecialchars($_REQUEST['q'] ?? ''); if (!empty($q)) { $query->where('username', 'name', "%{$q}%"); @@ -51,14 +51,14 @@ $userMedals = \App\Models\UserMedal::query()->where('uid', $CURUSER['id']) ->keyBy('medal_id') ; foreach ($rows as $row) { - if ($userMedals->has($row->id) || $CURUSER['seedbonus'] < $row->price) { - if ($userMedals->has($row->id)) { - $btnText = nexus_trans('medal.buy_already'); - } else { - $btnText = nexus_trans('medal.require_more_bonus'); - } - $disabled = ' disabled'; - $class = ''; + $disabled = ' disabled'; + $class = ''; + if ($userMedals->has($row->id)) { + $btnText = nexus_trans('medal.buy_already'); + } elseif ($row->get_type == \App\Models\Medal::GET_TYPE_GRANT) { + $btnText = nexus_trans('medal.grant_only'); + } elseif ($CURUSER['seedbonus'] < $row->price) { + $btnText = nexus_trans('medal.require_more_bonus'); } else { $btnText = nexus_trans('medal.buy_btn'); $disabled = ''; diff --git a/resources/lang/en/medal.php b/resources/lang/en/medal.php index 80b0781f..c7ca8b98 100644 --- a/resources/lang/en/medal.php +++ b/resources/lang/en/medal.php @@ -23,4 +23,5 @@ return [ 'buy_btn' => 'Buy', 'confirm_to_buy' => 'Sure you want to buy?', 'require_more_bonus' => 'Require more bonus', + 'grant_only' => 'Grant only', ]; diff --git a/resources/lang/zh_CN/medal.php b/resources/lang/zh_CN/medal.php index e6368c6d..6455bb39 100644 --- a/resources/lang/zh_CN/medal.php +++ b/resources/lang/zh_CN/medal.php @@ -23,4 +23,5 @@ return [ 'buy_btn' => '购买', 'confirm_to_buy' => '确定要购买吗?', 'require_more_bonus' => '需要更多魔力值', + 'grant_only' => '仅授予', ]; diff --git a/resources/lang/zh_TW/medal.php b/resources/lang/zh_TW/medal.php index 6941b279..a78247d5 100644 --- a/resources/lang/zh_TW/medal.php +++ b/resources/lang/zh_TW/medal.php @@ -23,4 +23,5 @@ return [ 'buy_btn' => '購買', 'confirm_to_buy' => '確定要購買嗎?', 'require_more_bonus' => '需要更多魔力值', + 'grant_only' => '僅授予', ];