[PLUGIN][RepeatNote] Fix getRepeatNotes query

This commit is contained in:
Diogo Peralta Cordeiro 2021-12-24 00:39:54 +00:00
parent 10e7c71b6e
commit 7407028891
Signed by: diogo
GPG Key ID: 18D2D35001FBFAB0
1 changed files with 13 additions and 13 deletions

View File

@ -1,6 +1,6 @@
<?php
declare(strict_types=1);
declare(strict_types = 1);
// {{{ License
@ -78,15 +78,15 @@ class NoteRepeat extends Entity
public static function getNoteRepeats(Note $note): array
{
return DB::sql(
return DB::dql(
<<<'EOF'
select {select} from note n
inner join note_repeat nr
on nr.note_id = n.id
where repeat_of = :note_id
order by n.created DESC
select n from note as n
inner join note_repeat as nr
with nr.note_id = n.id
where nr.repeat_of = :note_id
order by n.created DESC, n.id DESC
EOF,
['note_id' => $note->getId()]
['note_id' => $note->getId()],
);
}