storing analytics data

This commit is contained in:
2026-02-27 09:46:51 +01:00
parent 15b7b77d20
commit f0cca76eb3
57 changed files with 3478 additions and 466 deletions

View File

@@ -250,6 +250,12 @@ class Artwork extends Model
'created_at' => $this->published_at?->toDateString() ?? $this->created_at?->toDateString() ?? '',
'is_public' => (bool) $this->is_public,
'is_approved' => (bool) $this->is_approved,
// ── Trending / discovery fields ────────────────────────────────────
'trending_score_24h' => (float) ($this->trending_score_24h ?? 0),
'trending_score_7d' => (float) ($this->trending_score_7d ?? 0),
'favorites_count' => (int) ($stat?->favorites ?? 0),
'awards_received_count' => (int) ($awardStat?->score_total ?? 0),
'downloads_count' => (int) ($stat?->downloads ?? 0),
'awards' => [
'gold' => $awardStat?->gold_count ?? 0,
'silver' => $awardStat?->silver_count ?? 0,