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

修改category和item search 中best seller 查询,第二排序name asc

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

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


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

@@ -3827,7 +3827,7 @@
         NSString *order_best_seller = @"m.name asc";
         NSString *order_best_seller = @"m.name asc";
         if ([params[@"bestseller"] isEqualToString:@"Yes"]) {
         if ([params[@"bestseller"] isEqualToString:@"Yes"]) {
             best_seller = @"and best_seller > 0";
             best_seller = @"and best_seller > 0";
-            order_best_seller = @"m.best_seller desc";
+            order_best_seller = @"m.best_seller desc,m.name asc";
         }
         }
         
         
         // price
         // price
@@ -4005,7 +4005,7 @@
             case 3:
             case 3:
             {
             {
                 where=@"m.best_seller>0";
                 where=@"m.best_seller>0";
-                orderby=@"m.best_seller desc";
+                orderby=@"m.best_seller desc,m.name asc";
                 break;
                 break;
             }
             }
             default:
             default:
@@ -4061,7 +4061,7 @@
 
 
         if ([params[@"bestseller"] isEqualToString:@"Yes"]) {
         if ([params[@"bestseller"] isEqualToString:@"Yes"]) {
             best_seller = @"and best_seller > 0";
             best_seller = @"and best_seller > 0";
-            order_best_seller = @"m.best_seller desc";
+            order_best_seller = @"m.best_seller desc,m.name asc";
         }
         }
         
         
         // price
         // price
@@ -4310,7 +4310,8 @@
     int orderId = [params[@"orderId"] intValue];
     int orderId = [params[@"orderId"] intValue];
     NSMutableDictionary* ret = [self dictionaryFileName:@"orderDetail.json"];
     NSMutableDictionary* ret = [self dictionaryFileName:@"orderDetail.json"];
     
     
-    NSString* sql=[NSString stringWithFormat:@"select o._id,o.so_id,o.poNumber,o.create_time,o.status,o.TotalCuft,o.TotalWeight,o.TotalCarton,decrypt(c.company_name),o.customer_contact,decrypt(c.addr_1),c.addr_2,c.addr_3,c.addr_4,o.logist,o.shipping,o.lift_gate_value,o.general_notes,o.internal_notes,o.paymentType,o.lift_gate,o.receive_name,o.receive_contact,o.receive_ext,o.sender_name,o.sender_contact,o.sender_ext,o.shipping_billto_name,o.shipping_billto_contact,o.shipping_billto_ext,o.billing_name,o.billing_contact,o.billing_ext,o.returnto_name,o.returnto_contact,o.returnto_ext,o.handling_fee_value,o.paymentsAndCredits,o.total_price,o.customer_cid,o.credit_card_first_name,o.credit_card_last_name,o.credit_card_address1,o.credit_card_address2,o.credit_card_zipcode,o.credit_card_type,o.credit_card_number,o.credit_card_security_code,o.credit_card_expiration,o.credit_card_city,o.credit_card_state,o.shipNull,o.erpOrderStatus from (select _id,so_id,poNumber,create_time,status,TotalCuft,TotalWeight,TotalCarton,customer_cid,customer_contact,logist,shipping,lift_gate_value,general_notes,internal_notes,paymentType,lift_gate,receive_name,receive_contact,receive_ext,sender_name,sender_contact,sender_ext,shipping_billto_name,shipping_billto_contact,shipping_billto_ext,billing_name,billing_contact,billing_ext,returnto_name,returnto_contact,returnto_ext,handling_fee_value,paymentsAndCredits,total_price,customer_cid,credit_card_first_name,credit_card_last_name,credit_card_address1,credit_card_address2,credit_card_zipcode,credit_card_type,credit_card_number,credit_card_security_code,credit_card_expiration,credit_card_city,credit_card_state,ifnull(shipping,'ship_null') as shipNull,erpOrderStatus from offline_order where _id=%d) o left join offline_contact c on o.customer_cid=c.contact_id",orderId ];
+    // decrypt card number and card security code
+    NSString* sql=[NSString stringWithFormat:@"select o._id,o.so_id,o.poNumber,o.create_time,o.status,o.TotalCuft,o.TotalWeight,o.TotalCarton,decrypt(c.company_name),o.customer_contact,decrypt(c.addr_1),c.addr_2,c.addr_3,c.addr_4,o.logist,o.shipping,o.lift_gate_value,o.general_notes,o.internal_notes,o.paymentType,o.lift_gate,o.receive_name,o.receive_contact,o.receive_ext,o.sender_name,o.sender_contact,o.sender_ext,o.shipping_billto_name,o.shipping_billto_contact,o.shipping_billto_ext,o.billing_name,o.billing_contact,o.billing_ext,o.returnto_name,o.returnto_contact,o.returnto_ext,o.handling_fee_value,o.paymentsAndCredits,o.total_price,o.customer_cid,o.credit_card_first_name,o.credit_card_last_name,o.credit_card_address1,o.credit_card_address2,o.credit_card_zipcode,o.credit_card_type,decrypt(o.credit_card_number),decrypt(o.credit_card_security_code),o.credit_card_expiration,o.credit_card_city,o.credit_card_state,o.shipNull,o.erpOrderStatus from (select _id,so_id,poNumber,create_time,status,TotalCuft,TotalWeight,TotalCarton,customer_cid,customer_contact,logist,shipping,lift_gate_value,general_notes,internal_notes,paymentType,lift_gate,receive_name,receive_contact,receive_ext,sender_name,sender_contact,sender_ext,shipping_billto_name,shipping_billto_contact,shipping_billto_ext,billing_name,billing_contact,billing_ext,returnto_name,returnto_contact,returnto_ext,handling_fee_value,paymentsAndCredits,total_price,customer_cid,credit_card_first_name,credit_card_last_name,credit_card_address1,credit_card_address2,credit_card_zipcode,credit_card_type,credit_card_number,credit_card_security_code,credit_card_expiration,credit_card_city,credit_card_state,ifnull(shipping,'ship_null') as shipNull,erpOrderStatus from offline_order where _id=%d) o left join offline_contact c on o.customer_cid=c.contact_id",orderId ];
     
     
     sqlite3 *db = [iSalesDB get_db];
     sqlite3 *db = [iSalesDB get_db];
     sqlite3_stmt * statement;
     sqlite3_stmt * statement;