API: torrents upload/list

This commit is contained in:
xiaomlove
2025-04-17 01:39:40 +07:00
parent 0d3a46231d
commit 2b029eba10
72 changed files with 2332 additions and 507 deletions
+5
View File
@@ -22,10 +22,15 @@ class MedalResource extends JsonResource
'image_large' => $this->image_large,
'image_small' => $this->image_small,
'price' => $this->price,
'price_human' => number_format($this->price),
'duration' => $this->duration,
'description' => $this->description,
'expire_at' => $this->whenPivotLoaded('user_medals', function () {return $this->pivot->expire_at;}),
'user_medal_id' => $this->whenPivotLoaded('user_medals', function () {return $this->pivot->id;}),
'wearing_status' => $this->whenPivotLoaded('user_medals', function () {return $this->pivot->status;}),
'wearing_status_text' => $this->whenPivotLoaded('user_medals', function () {
return nexus_trans("medal.wearing_status_text." . $this->pivot->status);
}),
];
}
}