mirror of
https://code.castopod.org/adaures/castopod
synced 2025-06-05 17:02:01 +00:00
fix(home): remove hardcoded prefix in getAllPodcasts query
This commit is contained in:
parent
b5c0b72093
commit
92d5cc50a3
@ -178,10 +178,10 @@ class PodcastModel extends Model
|
|||||||
if ($orderBy === 'activity') {
|
if ($orderBy === 'activity') {
|
||||||
$prefix = $this->db->getPrefix();
|
$prefix = $this->db->getPrefix();
|
||||||
|
|
||||||
$fediverseTablePrefix = config('Fediverse')
|
$fediverseTablePrefix = $prefix . config('Fediverse')
|
||||||
->tablesPrefix;
|
->tablesPrefix;
|
||||||
$this->select(
|
$this->select(
|
||||||
'podcasts.*, MAX(' . $prefix . $fediverseTablePrefix . 'posts.published_at' . ') as max_published_at'
|
'podcasts.*, MAX(' . $fediverseTablePrefix . 'posts.published_at' . ') as max_published_at'
|
||||||
)
|
)
|
||||||
->join(
|
->join(
|
||||||
$fediverseTablePrefix . 'posts',
|
$fediverseTablePrefix . 'posts',
|
||||||
@ -189,11 +189,11 @@ class PodcastModel extends Model
|
|||||||
'left'
|
'left'
|
||||||
)
|
)
|
||||||
->where(
|
->where(
|
||||||
'`' . $prefix . $fediverseTablePrefix . 'posts`.`published_at` <= UTC_TIMESTAMP()',
|
'`' . $fediverseTablePrefix . 'posts`.`published_at` <= UTC_TIMESTAMP()',
|
||||||
null,
|
null,
|
||||||
false
|
false
|
||||||
)->orWhere($fediverseTablePrefix . 'posts.published_at', null)
|
)->orWhere($fediverseTablePrefix . 'posts.published_at', null)
|
||||||
->groupBy('cp_podcasts.actor_id')
|
->groupBy('podcasts.actor_id')
|
||||||
->orderBy('max_published_at', 'DESC');
|
->orderBy('max_published_at', 'DESC');
|
||||||
} elseif ($orderBy === 'created_desc') {
|
} elseif ($orderBy === 'created_desc') {
|
||||||
$this->orderBy('created_at', 'DESC');
|
$this->orderBy('created_at', 'DESC');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user