浏览代码

修改offline_getStateByCountryCode:方法中sql语句

Pen Li 9 年之前
父节点
当前提交
5a7f49d2da

二进制
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


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

@@ -2604,11 +2604,11 @@
         
         while (sqlite3_step(statement) == SQLITE_ROW) {
             char *name = (char *) sqlite3_column_text(statement, 1); // 全称
-            char *code = (char *) sqlite3_column_text(statement, 2); // 缩写
+//            char *code = (char *) sqlite3_column_text(statement, 2); // 缩写
             int code_id = sqlite3_column_int(statement, 3); // id
             
             NSMutableDictionary *countryDic = [NSMutableDictionary dictionaryWithCapacity:2];
-            [countryDic setValue:[NSString stringWithFormat:@"%s %s",code,name] forKey:@"value"];
+            [countryDic setValue:[NSString stringWithFormat:@"%s",name] forKey:@"value"];
             [countryDic setValue:[NSString stringWithFormat:@"%d",code_id] forKey:@"value_id"];
             [countryDic setValue:[NSNumber numberWithInt:0] forKey:@"check"];
             
@@ -2630,9 +2630,10 @@
     
     sqlite3 *db = [iSalesDB get_db];
     
-    NSString *sqlQuery = [NSString stringWithFormat:@"select * from offline_state where country_code = %@;",countryCode];
+    NSString *sqlQuery = [NSString stringWithFormat:@"select * from offline_state where country_code = '%@';",countryCode];
     
 //    NSString *sqlQuery = [NSString stringWithFormat:@"select * from offline_state"];
+    DebugLog(@"query state:%@",sqlQuery);
     
     sqlite3_stmt * statement;