|
|
@@ -1798,26 +1798,6 @@
|
|
|
|
|
|
return [RAUtils dict2data:ret];
|
|
|
}
|
|
|
-+(NSData*) offline_updategnotes :(NSMutableDictionary *) params
|
|
|
-{
|
|
|
- return nil;
|
|
|
-}
|
|
|
-+(NSData*) offline_movecart2wish :(NSMutableDictionary *) params
|
|
|
-{
|
|
|
- return nil;
|
|
|
-}
|
|
|
-+(NSData*) offline_cartremove :(NSMutableDictionary *) params
|
|
|
-{
|
|
|
- return nil;
|
|
|
-}
|
|
|
-+(NSData*) offline_cartsetprice :(NSMutableDictionary *) params
|
|
|
-{
|
|
|
- return nil;
|
|
|
-}
|
|
|
-+(NSData*) offline_cartsetlnotes :(NSMutableDictionary *) params
|
|
|
-{
|
|
|
- return nil;
|
|
|
-}
|
|
|
+(NSData*) offline_login :(NSMutableDictionary *) params
|
|
|
{
|
|
|
|
|
|
@@ -5456,6 +5436,86 @@
|
|
|
return [RAUtils dict2data:ret];
|
|
|
}
|
|
|
|
|
|
+#pragma mark update gnotes
|
|
|
++(NSData*) offline_updategnotes :(NSMutableDictionary *) params
|
|
|
+{
|
|
|
+ DebugLog(@"params: %@",params);
|
|
|
+// comments = Meyoyoyoyoyoyoy;
|
|
|
+// orderCode = MOB1608110001;
|
|
|
+// password = 123456;
|
|
|
+// user = EvanK;
|
|
|
+
|
|
|
+ NSString *sql = [NSString stringWithFormat:@"update offline_order set general_notes = '%@' where so_id = '%@';",[self valueInParams:params key:@"comments"],[self valueInParams:params key:@"orderCode"]];
|
|
|
+ int ret = [iSalesDB execSql:sql];
|
|
|
+
|
|
|
+ NSMutableDictionary *dic = [NSMutableDictionary dictionary];
|
|
|
+ [dic setValue:[NSNumber numberWithInteger:ret] forKey:@"result"];
|
|
|
+ [dic setValue:@"Regular Mode" forKey:@"mode"];
|
|
|
+ [dic setValue:@"160409" forKey:@"min_ver"];
|
|
|
+
|
|
|
+ return [RAUtils dict2data:dic];
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark move to wishlist
|
|
|
+
|
|
|
++(NSData*) offline_movecart2wish :(NSMutableDictionary *) params
|
|
|
+{
|
|
|
+
|
|
|
+
|
|
|
+ NSString *_id = [self valueInParams:params key:@"cartItemId"];
|
|
|
+
|
|
|
+ NSString *orderCode = [self valueInParams:params key:@"orderCode"];
|
|
|
+
|
|
|
+ NSString *sql = [NSString stringWithFormat:@"select product_id,item_count,item_id from offline_cart where so_no = '%@' and _id = %@;",orderCode,_id];
|
|
|
+ sqlite3 *db = [iSalesDB get_db];
|
|
|
+
|
|
|
+ __block NSString *product_id = nil;
|
|
|
+ __block int item_count = 0;
|
|
|
+ __block NSString *item_id = nil;
|
|
|
+ [iSalesDB jk_query:sql db:db close:NO completion:^(sqlite3_stmt *stmt, NSMutableDictionary *container, long *count) {
|
|
|
+ product_id = [self textAtColumn:0 statement:stmt];
|
|
|
+ item_count = sqlite3_column_int(stmt, 1);
|
|
|
+ item_id = [self textAtColumn:2 statement:stmt];
|
|
|
+ }];
|
|
|
+
|
|
|
+ //
|
|
|
+// NSString *contactIdSql = [NSString stringWithFormat:@"select customer_cid from offline_order where so_id = '%@';",orderCode];
|
|
|
+// __block NSString *contact_id = nil;
|
|
|
+// [iSalesDB jk_query:contactIdSql db:db close:NO completion:^(sqlite3_stmt *stmt, NSMutableDictionary *container, long *count) {
|
|
|
+// contact_id = [self textAtColumn:0 statement:stmt];
|
|
|
+// }];
|
|
|
+
|
|
|
+ NSString *insertIntoWishlistSql = [NSString stringWithFormat:@"insert into wishlist (product_id,item_id,qty) values (%@,%@,%d);",product_id,item_id,item_count];
|
|
|
+ int ret = [iSalesDB execSql:insertIntoWishlistSql db:db];
|
|
|
+
|
|
|
+ int wish_count = [iSalesDB get_recordcount:db table:@"wishlist" where:nil];
|
|
|
+ NSMutableDictionary *dic = [NSMutableDictionary dictionary];
|
|
|
+ [dic setValue:[NSNumber numberWithInteger:ret] forKey:@"result"];
|
|
|
+ [dic setValue:@"Regular Mode" forKey:@"mode"];
|
|
|
+ [dic setValue:@"160409" forKey:@"min_ver"];
|
|
|
+ [dic setValue:[NSNumber numberWithInteger:wish_count] forKey:@"wish_count"];
|
|
|
+
|
|
|
+ // 删除
|
|
|
+ NSString *deleteSql = [NSString stringWithFormat:@"delete from offline_cart where _id = %@;",_id];
|
|
|
+ [iSalesDB execSql:deleteSql db:db];
|
|
|
+
|
|
|
+ [iSalesDB close_db:db];
|
|
|
+
|
|
|
+ return [RAUtils dict2data:dic];
|
|
|
+}
|
|
|
++(NSData*) offline_cartremove :(NSMutableDictionary *) params
|
|
|
+{
|
|
|
+
|
|
|
+ return nil;
|
|
|
+}
|
|
|
++(NSData*) offline_cartsetprice :(NSMutableDictionary *) params
|
|
|
+{
|
|
|
+ return nil;
|
|
|
+}
|
|
|
++(NSData*) offline_cartsetlnotes :(NSMutableDictionary *) params
|
|
|
+{
|
|
|
+ return nil;
|
|
|
+}
|
|
|
|
|
|
|
|
|
|