Просмотр исходного кода

修正offline_getStateByCountryCode:方法中country_code条件的选择

Pen Li 9 лет назад
Родитель
Сommit
8ddee9da79

BIN
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


+ 8 - 4
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m

@@ -2608,8 +2608,8 @@
             int code_id = sqlite3_column_int(statement, 3); // id
             
             NSMutableDictionary *countryDic = [NSMutableDictionary dictionaryWithCapacity:2];
-            [countryDic setValue:[NSString stringWithUTF8String:name] forKey:@"value"];
-            [countryDic setValue:[NSString stringWithUTF8String:code] forKey:@"value_id"];
+            [countryDic setValue:[NSString stringWithFormat:@"%s %s",code,name] forKey:@"value"];
+            [countryDic setValue:[NSString stringWithFormat:@"%d",code_id] forKey:@"value_id"];
             [countryDic setValue:[NSNumber numberWithInt:0] forKey:@"check"];
             
             NSString *key = [NSString stringWithFormat:@"val_%d",code_id - 1];
@@ -2630,8 +2630,10 @@
     
     sqlite3 *db = [iSalesDB get_db];
     
-    NSString *sqlQuery = [NSString stringWithFormat:@"select * from offline_state;"];
-    // select * from offline_state where country_code = %d;",[countryCode integerValue]
+    NSString *sqlQuery = [NSString stringWithFormat:@"select * from offline_state where country_code = %d;",[countryCode integerValue]];
+    
+//    NSString *sqlQuery = [NSString stringWithFormat:@"select * from offline_state"];
+    
     sqlite3_stmt * statement;
     
     if (sqlite3_prepare_v2(db, [sqlQuery UTF8String], -1, &statement, nil) == SQLITE_OK) {
@@ -2788,7 +2790,9 @@
     [self setValue:repDic forItemKey:@"item_17" valueKey:@"cadedate" inDictionary:section_0];
     
     [ret setValue:section_0 forKey:@"section_0"];
+    
     return [RAUtils dict2data:ret];
 }
 
+
 @end