Compare commits
2 Commits
cb9bf082f4
...
607cb2ded2
Author | SHA1 | Date |
---|---|---|
Natty | 607cb2ded2 | |
Natty | aebc9803db |
|
@ -47,16 +47,12 @@ impl NoteResolveMode {
|
||||||
NoteResolveMode::Multiple(ids) => id_col.is_in(ids),
|
NoteResolveMode::Multiple(ids) => id_col.is_in(ids),
|
||||||
NoteResolveMode::PinsFromUserId(user_id) => {
|
NoteResolveMode::PinsFromUserId(user_id) => {
|
||||||
let sub_query = Query::select()
|
let sub_query = Query::select()
|
||||||
.expr(SelectExpr {
|
.column(user_note_pining::Column::NoteId)
|
||||||
expr: Expr::col(user_note_pining::Column::NoteId).into(),
|
|
||||||
alias: None,
|
|
||||||
window: None,
|
|
||||||
})
|
|
||||||
.from(user_note_pining::Entity)
|
.from(user_note_pining::Entity)
|
||||||
.and_where(Expr::col(note_reaction::Column::UserId).eq(user_id))
|
.and_where(Expr::col((user_note_pining::Entity, user_note_pining::Column::UserId)).eq(user_id))
|
||||||
.order_by_columns([
|
.order_by_columns([
|
||||||
(user_note_pining::Column::CreatedAt, Order::Desc),
|
((user_note_pining::Entity, user_note_pining::Column::CreatedAt), Order::Desc),
|
||||||
(user_note_pining::Column::Id, Order::Desc)
|
((user_note_pining::Entity, user_note_pining::Column::Id), Order::Desc)
|
||||||
])
|
])
|
||||||
.take();
|
.take();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue