Explorar o código

160920
Add: update modify_time trigger on offline_order, offline_contact, offline_cart, wishlist;

Ray Zhang %!s(int64=9) %!d(string=hai) anos
pai
achega
d7db655a93
Modificáronse 1 ficheiros con 11 adicións e 1 borrados
  1. 11 1
      RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m

+ 11 - 1
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m

@@ -2061,7 +2061,14 @@
     
     
     NSString* orderCode = [params valueForKey:@"orderCode"];
-    
+    UIApplication * app = [UIApplication sharedApplication];
+    AppDelegate *appDelegate = (AppDelegate *)[app delegate];
+    if(![appDelegate.order_code isEqualToString:orderCode]&& appDelegate.order_code.length!=0)
+    {
+        appDelegate.disable_trigger=true;
+        [iSalesDB execSql:@"delete from offline_order where status=0;"];
+        appDelegate.disable_trigger=false;
+    }
     
     
     sqlite3 *db = [iSalesDB get_db];
@@ -2648,6 +2655,9 @@
             int wish_count = [iSalesDB get_recordcount:db table:@"wishlist" where:@"1=1"];
             [header setObject:[NSString stringWithFormat:@"%d",wish_count] forKey:@"wish_count"];
             
+//            int portfolio_count = [iSalesDB get_recordcount:db table:@"portfoliolist" where:@"1=1"];
+//            [header setObject:[NSString stringWithFormat:@"%d",wish_count] forKey:@"portfolio_count"];
+            
             [ret setObject:header forKey:@"header"];
             [ret setValue:nsmode   forKey:@"mode"];