Преглед изворни кода

fix: align total_price and invoice_amount in backend orders list

unknown пре 1 дан
родитељ
комит
5db42c007e
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      backend/routers/orders.py

+ 1 - 1
backend/routers/orders.py

@@ -258,7 +258,7 @@ async def get_admin_orders(
     where_sql = f"WHERE {' AND '.join(where_clauses)}" if where_clauses else ""
 
     query = f"""
-    SELECT o.*, u.can_chat,
+    SELECT o.*, u.can_chat, o.total_price AS invoice_amount,
            (SELECT count(*) FROM order_messages om WHERE om.order_id = o.id AND om.is_from_admin = FALSE AND om.is_read = FALSE) as unread_count,
            GROUP_CONCAT(IF(f.id IS NOT NULL, JSON_OBJECT('id', f.id, 'filename', f.filename, 'file_path', f.file_path, 'file_size', f.file_size, 'quantity', f.quantity, 'preview_path', f.preview_path, 'print_time', f.print_time, 'filament_g', f.filament_g), NULL)) as files
     FROM orders o