huxiaoqiang %!s(int64=4) %!d(string=hai) anos
pai
achega
e92d54207c
Modificáronse 2 ficheiros con 13 adicións e 12 borrados
  1. 8 8
      lib/https/my_request.dart
  2. 5 4
      lib/paegs/mine_page/order_page/order_page.dart

+ 8 - 8
lib/https/my_request.dart

@@ -221,19 +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');
+      if(myShopUIDs.length==0){
+        return;
       }
       MyDio().query({
         "key": "order",
         "filters": {
           "or": true,
-          "conditions": conditions,
+          "conditions": [
+            "state == $orderStateUnpaid",
+            'buyer_uid==0',
+            'buyer_name LIKE ${MyCookie().getName()}',
+            'shop_uid IN $myShopUIDs'
+          ],
           "filters": [
             {
               "conditions": [

+ 5 - 4
lib/paegs/mine_page/order_page/order_page.dart

@@ -30,7 +30,7 @@ class _OrderPageState extends State<OrderPage> {
   List<SmartOrderBeanDataData> orders = [];
   RefreshController controller = RefreshController(initialRefresh: true);
   int page = 1;
-  List<int> myShopUIDs  = [];
+  List<int> myShopUIDs = [];
 
   @override
   void initState() {
@@ -247,9 +247,7 @@ class _OrderPageState extends State<OrderPage> {
       conditions.add("state == $orderStateUnpaid");
       conditions.add('buyer_uid==0');
       conditions.add('buyer_name LIKE ${MyCookie().getName()}');
-      if(myShopUIDs.length>0){
-        conditions.add('shop_uid IN $myShopUIDs');
-      }
+      conditions.add('shop_uid IN $myShopUIDs');
     }
     var filters;
     if (selectedIndex == 2) {
@@ -322,6 +320,9 @@ class _OrderPageState extends State<OrderPage> {
         entity.data.data.forEach((element) {
           myShopUIDs.add(element.shopUid);
         });
+        if(myShopUIDs.length==0){
+          return;
+        }
         checkingOrder();
       }
     }, (error) {});