|
@@ -132,14 +132,14 @@ class AppAnnotationService:
|
|
|
MessageAnnotation.content.ilike("%{}%".format(keyword)),
|
|
|
)
|
|
|
)
|
|
|
- .order_by(MessageAnnotation.created_at.desc())
|
|
|
+ .order_by(MessageAnnotation.created_at.desc(), MessageAnnotation.id.desc())
|
|
|
.paginate(page=page, per_page=limit, max_per_page=100, error_out=False)
|
|
|
)
|
|
|
else:
|
|
|
annotations = (
|
|
|
db.session.query(MessageAnnotation)
|
|
|
.filter(MessageAnnotation.app_id == app_id)
|
|
|
- .order_by(MessageAnnotation.created_at.desc())
|
|
|
+ .order_by(MessageAnnotation.created_at.desc(), MessageAnnotation.id.desc())
|
|
|
.paginate(page=page, per_page=limit, max_per_page=100, error_out=False)
|
|
|
)
|
|
|
return annotations.items, annotations.total
|