From 729e5a25cb30aed8dc678a51ccba04b523200620 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Wed, 28 Aug 2024 04:42:51 +0800 Subject: [PATCH] fix user medals --- include/constants.php | 2 +- public/medal.php | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/include/constants.php b/include/constants.php index 5523ddd3..e96aedb5 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,6 +1,6 @@ TABLE; $now = now(); +$user = \App\Models\User::query()->findOrFail($CURUSER['id']); $table .= ''; -$userMedals = \App\Models\UserMedal::query()->where('uid', $CURUSER['id']) - ->orderBy('id', 'desc') - ->get() - ->keyBy('medal_id') -; +$userMedals = $user->valid_medals->keyBy('id'); foreach ($rows as $row) { $buyDisabled = $giftDisabled = ' disabled'; $buyClass = $giftClass = '';