medal valid forever text

This commit is contained in:
xiaomlove
2023-01-21 13:58:35 +08:00
parent 19be90c207
commit 3762c15dc7
3 changed files with 10 additions and 2 deletions
+8
View File
@@ -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();
+1 -1
View File
@@ -71,7 +71,7 @@ foreach ($rows as $row) {
);
$table .= sprintf(
'<tr><td>%s</td><td>%s</td><td><img src="%s" style="max-width: 60px;max-height: 60px;" class="preview" /></td><td>%s</td><td>%s</td><td>%s</td><td>%s</td>',
$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 .= '</tbody></table>';
+1 -1
View File
@@ -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 = [];