mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-18 07:51:55 +03:00
Fixed posts without open rate being ordered in reverse
refs https://github.com/TryGhost/Ghost/issues/12420 - adds additional sorting by post creation date so that posts below those with an open rate appear in a more useful order
This commit is contained in:
parent
7038f381b3
commit
7c57ffd6a6
@ -109,8 +109,11 @@ Post = ghostBookshelf.Model.extend({
|
|||||||
// *1.0 is needed on one of the columns to prevent sqlite from
|
// *1.0 is needed on one of the columns to prevent sqlite from
|
||||||
// performing integer division rounding and always giving 0.
|
// performing integer division rounding and always giving 0.
|
||||||
// Order by emails.track_opens desc first so we always tracked emails
|
// Order by emails.track_opens desc first so we always tracked emails
|
||||||
// before untracked emails in the posts list
|
// before untracked emails in the posts list.
|
||||||
orderByRaw: `emails.track_opens desc, emails.opened_count * 1.0 / emails.email_count * 100 ${direction}`,
|
orderByRaw: `
|
||||||
|
emails.track_opens desc,
|
||||||
|
emails.opened_count * 1.0 / emails.email_count * 100 ${direction},
|
||||||
|
posts.created_at desc`,
|
||||||
eagerLoad: 'email.open_rate'
|
eagerLoad: 'email.open_rate'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user