Hide future-dated releases in artist profile latest releases
This commit is contained in:
@@ -71,11 +71,13 @@ class ArtistsController
|
|||||||
SELECT id, title, slug, release_date, cover_url, artist_name
|
SELECT id, title, slug, release_date, cover_url, artist_name
|
||||||
FROM ac_releases
|
FROM ac_releases
|
||||||
WHERE is_published = 1
|
WHERE is_published = 1
|
||||||
|
AND (release_date IS NULL OR release_date <= :today)
|
||||||
AND (artist_id = :artist_id OR artist_name = :artist_name)
|
AND (artist_id = :artist_id OR artist_name = :artist_name)
|
||||||
ORDER BY release_date DESC, created_at DESC
|
ORDER BY release_date DESC, created_at DESC
|
||||||
LIMIT 2
|
LIMIT 2
|
||||||
");
|
");
|
||||||
$relStmt->execute([
|
$relStmt->execute([
|
||||||
|
':today' => date('Y-m-d'),
|
||||||
':artist_id' => (int)($artist['id'] ?? 0),
|
':artist_id' => (int)($artist['id'] ?? 0),
|
||||||
':artist_name' => (string)($artist['name'] ?? ''),
|
':artist_name' => (string)($artist['name'] ?? ''),
|
||||||
]);
|
]);
|
||||||
@@ -84,11 +86,13 @@ class ArtistsController
|
|||||||
SELECT id, title, slug, release_date, cover_url, artist_name
|
SELECT id, title, slug, release_date, cover_url, artist_name
|
||||||
FROM ac_releases
|
FROM ac_releases
|
||||||
WHERE is_published = 1
|
WHERE is_published = 1
|
||||||
|
AND (release_date IS NULL OR release_date <= :today)
|
||||||
AND artist_name = :artist_name
|
AND artist_name = :artist_name
|
||||||
ORDER BY release_date DESC, created_at DESC
|
ORDER BY release_date DESC, created_at DESC
|
||||||
LIMIT 2
|
LIMIT 2
|
||||||
");
|
");
|
||||||
$relStmt->execute([
|
$relStmt->execute([
|
||||||
|
':today' => date('Y-m-d'),
|
||||||
':artist_name' => (string)($artist['name'] ?? ''),
|
':artist_name' => (string)($artist['name'] ?? ''),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user