From 3762c15dc7c9affdf65c90030a8fbfcb775519e4 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Sat, 21 Jan 2023 13:58:35 +0800 Subject: [PATCH] medal valid forever text --- app/Models/Medal.php | 8 ++++++++ public/medal.php | 2 +- public/torrentrss.php | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/Models/Medal.php b/app/Models/Medal.php index 047085ce..ffe755d6 100644 --- a/app/Models/Medal.php +++ b/app/Models/Medal.php @@ -39,6 +39,14 @@ class Medal extends NexusModel return nexus_trans("medal.get_types." . $this->get_type); } + public function getDurationTextAttribute($value): string + { + if ($this->duration > 0) { + return $this->duration; + } + return nexus_trans("label.permanent"); + } + public function users(): \Illuminate\Database\Eloquent\Relations\BelongsToMany { return $this->belongsToMany(User::class, 'user_medals', 'medal_id', 'uid')->withTimestamps(); diff --git a/public/medal.php b/public/medal.php index 6881c45d..f7e9d1b6 100644 --- a/public/medal.php +++ b/public/medal.php @@ -71,7 +71,7 @@ foreach ($rows as $row) { ); $table .= sprintf( '%s%s%s%s%s%s', - $row->id, $row->name, $row->image_large, number_format($row->price), $row->duration, $row->description, $action + $row->id, $row->name, $row->image_large, number_format($row->price), $row->durationText, $row->description, $action ); } $table .= ''; diff --git a/public/torrentrss.php b/public/torrentrss.php index 0574cc2e..eeee2b8d 100644 --- a/public/torrentrss.php +++ b/public/torrentrss.php @@ -127,7 +127,7 @@ get_where("audiocodecs", "audiocodec", "aud"); $hasStickyFirst = $hasStickySecond = $hasStickyNormal = $noNormalResults = false; $prependIdArr = $prependRows = $normalRows = []; $stickyWhere = $normalWhere = ''; -if (isset($_GET['sticky'])) { +if (isset($_GET['sticky']) && $inclbookmarked == 0) { $stickyArr = explode(',', $_GET['sticky']); //Only handle sticky first + second $posStates = [];