Răsfoiți Sursa

云存订单检索

lhq 4 ani în urmă
părinte
comite
2de676f5f4
1 a modificat fișierele cu 7 adăugiri și 1 ștergeri
  1. 7 1
      Controller/OrderContrller.py

+ 7 - 1
Controller/OrderContrller.py

@@ -151,6 +151,8 @@ class OrderView(View):
             uid = request_dict.get('uid', None)
             channel = request_dict.get('channel', None)
             orderID = request_dict.get('orderID', None)
+            userID__username = request_dict.get('userID__username', None)
+            currency = request_dict.get('currency', None)
             page = int(page)
             line = int(line)
             omqs = Order_Model.objects.all()
@@ -161,10 +163,14 @@ class OrderView(View):
                 omqs = omqs.filter(channel=channel)
             if orderID:
                 omqs = omqs.filter(orderID=orderID)
+            if userID__username:
+                omqs = omqs.filter(userID__username=userID__username)
+            if currency:
+                omqs = omqs.filter(currency=currency)
             if not omqs.exists():
                 return response.json(0, [])
             count = omqs.count()
-            order_ql = omqs[(page - 1) * line:page * line].values("orderID", "UID", "channel", "desc", "price",
+            order_ql = omqs[(page - 1) * line:page * line].values("orderID", "UID", "userID__username", "channel", "desc", "price",
                                                                   "currency", "addTime", "updTime", "paypal",
                                                                   "payType",
                                                                   "rank__day",