huxiaoqiang 4 years ago
parent
commit
6629f3cabc
2 changed files with 12 additions and 7 deletions
  1. 9 6
      lib/https/my_request.dart
  2. 3 1
      lib/paegs/mine_page/order_page/order_page.dart

+ 9 - 6
lib/https/my_request.dart

@@ -221,16 +221,19 @@ void checkUnpaidThirdPartyOrders() {
       entity.data.data.forEach((element) {
         myShopUIDs.add(element.shopUid);
       });
+      var conditions = [
+        "state == $orderStateUnpaid",
+        'buyer_uid==0',
+        'buyer_name LIKE ${MyCookie().getName()}',
+      ];
+      if(myShopUIDs.length>0){
+        conditions.add('shop_uid IN $myShopUIDs');
+      }
       MyDio().query({
         "key": "order",
         "filters": {
           "or": true,
-          "conditions": [
-            "state == $orderStateUnpaid",
-            'buyer_uid==0',
-            'buyer_name LIKE ${MyCookie().getName()}',
-            'shop_uid IN $myShopUIDs'
-          ],
+          "conditions": conditions,
           "filters": [
             {
               "conditions": [

+ 3 - 1
lib/paegs/mine_page/order_page/order_page.dart

@@ -247,7 +247,9 @@ class _OrderPageState extends State<OrderPage> {
       conditions.add("state == $orderStateUnpaid");
       conditions.add('buyer_uid==0');
       conditions.add('buyer_name LIKE ${MyCookie().getName()}');
-      conditions.add('shop_uid IN $myShopUIDs');
+      if(myShopUIDs.length>0){
+        conditions.add('shop_uid IN $myShopUIDs');
+      }
     }
     var filters;
     if (selectedIndex == 2) {