|
|
@@ -284,9 +284,21 @@
|
|
|
{
|
|
|
|
|
|
NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
|
|
|
+
|
|
|
+ NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
|
|
|
+
|
|
|
+ NSString* ver = [defaults stringForKey:@"OfflineVer"] ;
|
|
|
+
|
|
|
+
|
|
|
+ NSString* where=@" 1=1";
|
|
|
+
|
|
|
+ if (ver!=nil) {
|
|
|
+
|
|
|
+ where=[NSString stringWithFormat:@"modify_time >'%@-%@-%@ %@:%@:%@'",[ver substringWithRange:NSMakeRange(0,4)],[ver substringWithRange:NSMakeRange(4,2)],[ver substringWithRange:NSMakeRange(6,2)],[ver substringWithRange:NSMakeRange(8,2)],[ver substringWithRange:NSMakeRange(10,2)],[ver substringWithRange:NSMakeRange(12,2)]];
|
|
|
+ }
|
|
|
sqlite3 *db = [iSalesDB get_db];
|
|
|
|
|
|
- NSString *sqlQuery =@"select _id,product_id,item_id,qty,create_time from wishlist";
|
|
|
+ NSString *sqlQuery =[NSString stringWithFormat:@"select _id,product_id,item_id,qty,create_time,modify_time,is_delete from wishlist where %@",where];
|
|
|
sqlite3_stmt * statement;
|
|
|
|
|
|
|
|
|
@@ -320,11 +332,21 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
+ char *modify_time = (char*)sqlite3_column_text(statement, 5);
|
|
|
+ NSString* nsmodify_time=nil;
|
|
|
+ if(modify_time!=nil)
|
|
|
+ {
|
|
|
+ nsmodify_time= [[NSString alloc]initWithUTF8String:modify_time];
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ int is_delete = sqlite3_column_int(statement, 6);
|
|
|
itemjson[@"_id"]=[NSNumber numberWithInt:_id];
|
|
|
itemjson[@"product_id"]=[NSNumber numberWithInt:product_id];
|
|
|
itemjson[@"item_id"]=[NSNumber numberWithInt:item_id];
|
|
|
itemjson[@"qty"]=[NSNumber numberWithInt:qty];
|
|
|
itemjson[@"create_time"]=nscreate_time;
|
|
|
+ itemjson[@"is_delete"]=[NSNumber numberWithInt:is_delete];
|
|
|
|
|
|
|
|
|
ret[[NSString stringWithFormat:@"item_%d",count]]=itemjson;
|