forked from rDrama/rDrama
1
0
Fork 0

order by ChatMembership created_utc

master
Aevann 2024-03-10 21:30:04 +02:00
parent 9236b5bd03
commit c90ad7005d
1 changed files with 1 additions and 1 deletions

View File

@ -142,7 +142,7 @@ def notifications_messages(v):
def notifications_chats(v):
criteria1 = (Chat.id == ChatMembership.chat_id, ChatMembership.user_id == v.id)
criteria2 = (Chat.id == ChatNotification.chat_id, ChatNotification.user_id == v.id)
chats = g.db.query(Chat, func.count(ChatNotification.chat_id)).join(ChatMembership, and_(*criteria1)).outerjoin(ChatNotification, and_(*criteria2)).group_by(Chat).order_by(func.count(ChatNotification.chat_id).desc(), Chat.name).all()
chats = g.db.query(Chat, func.count(ChatNotification.chat_id)).join(ChatMembership, and_(*criteria1)).outerjoin(ChatNotification, and_(*criteria2)).group_by(Chat).order_by(func.count(ChatNotification.chat_id).desc(), ChatMembership.created_utc.desc()).all()
return render_template("notifications.html", v=v, notifications=chats)
@app.get("/notifications/modmail")