Browse Source

Fix ordering

Eren Yilmaz 5 years ago
parent
commit
9e4d0f6d4d
1 changed files with 2 additions and 0 deletions
  1. 2 0
      model.py

+ 2 - 0
model.py

@@ -844,6 +844,7 @@ def trades(user_id, limit):
             datetime(dt,'localtime')
         FROM transactions
         WHERE seller_id = ? OR buyer_id = ?
+        ORDER BY rowid DESC -- equivalent to order by dt
         LIMIT ?
         ''', (user_id, user_id, user_id, limit,))
 
@@ -1174,6 +1175,7 @@ def get_old_orders(user_id, include_executed, include_canceled, limit):
              OR 
              ((order_history.status = 'Expired' OR order_history.status = 'Canceled') AND ?)
             )
+        ORDER BY order_history.rowid DESC -- equivalent to ordering by creation time
         LIMIT ?
         ''', (user_id, include_executed, include_canceled, limit))