|
@@ -4677,11 +4677,10 @@
|
|
|
keyword = [self translateSingleQuote:keyword]; // 转义单引号
|
|
keyword = [self translateSingleQuote:keyword]; // 转义单引号
|
|
|
NSString *orderStatus = [params valueForKey:@"orderStatus"];
|
|
NSString *orderStatus = [params valueForKey:@"orderStatus"];
|
|
|
|
|
|
|
|
- NSString *contactID = [self valueInParams:params key:@"contactId"]; // 新建order时会多一个contactId,此时status = 0
|
|
|
|
|
|
|
|
|
|
NSString* where=@"1 = 1";
|
|
NSString* where=@"1 = 1";
|
|
|
if(keyword.length>0)
|
|
if(keyword.length>0)
|
|
|
- where=[where stringByAppendingString:[NSString stringWithFormat:@" and (lower(o.order_id) like '%%%@%%' or lower(c.company_name) like '%%%@%%' or lower(c.company_name) like '%%%@%%' or lower(o.create_by) like '%%%@%%')",keyword.lowercaseString,keyword.lowercaseString,keyword.lowercaseString,keyword.lowercaseString]];
|
|
|
|
|
|
|
+ where=[where stringByAppendingString:[NSString stringWithFormat:@" and (lower(o.so_id) like '%%%@%%' or lower(o.sales_rep) like '%%%@%%' or lower(decrypt(c.company_name)) like '%%%@%%' or lower(o.create_by) like '%%%@%%')",keyword.lowercaseString,keyword.lowercaseString,keyword.lowercaseString,keyword.lowercaseString]];
|
|
|
|
|
|
|
|
if (orderStatus.length > 0) {
|
|
if (orderStatus.length > 0) {
|
|
|
NSArray *order_status_array = [orderStatus componentsSeparatedByString:@","];
|
|
NSArray *order_status_array = [orderStatus componentsSeparatedByString:@","];
|
|
@@ -4698,11 +4697,6 @@
|
|
|
where = [where stringByAppendingString:[NSString stringWithFormat:@"%@ o.status = %@",condition,status]];
|
|
where = [where stringByAppendingString:[NSString stringWithFormat:@"%@ o.status = %@",condition,status]];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (contactID.length) {
|
|
|
|
|
-
|
|
|
|
|
- where = [where stringByAppendingString:[NSString stringWithFormat:@" or customer_cid = '%@'",[contactID stringByReplacingOccurrencesOfString:@"'" withString:@"''"]]];
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
where = [where stringByAppendingString:@" )"];
|
|
where = [where stringByAppendingString:@" )"];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|