|
|
@@ -4178,28 +4178,17 @@
|
|
|
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
|
|
|
formatter.dateFormat = formate;
|
|
|
|
|
|
- DebugLog(@"date:%@",dateTime);
|
|
|
-
|
|
|
-// NSTimeZone *timeZone = [NSTimeZone timeZoneWithName:@"asia/shanghai"];
|
|
|
- [formatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];;
|
|
|
+// [formatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];;
|
|
|
|
|
|
NSDate *date = [formatter dateFromString:dateTime];
|
|
|
|
|
|
formatter.dateFormat = newFormate;
|
|
|
- NSString *newDateTime = [formatter stringFromDate:date];
|
|
|
- DebugLog(@"new date:%@",newDateTime);
|
|
|
- return newDateTime;
|
|
|
-
|
|
|
- // 同样的问题
|
|
|
-// NSDateFormatter *f1 = [[NSDateFormatter alloc] init];
|
|
|
-// f1.dateFormat = newFormate;
|
|
|
-//
|
|
|
-// return [f1 stringFromDate:date];
|
|
|
+ return [formatter stringFromDate:date];
|
|
|
|
|
|
}
|
|
|
|
|
|
-+ (NSString *)changeDateTime:(NSString *)dateTime {
|
|
|
- return [self changeDateTime:dateTime Formate:@"YYYY-MM-DD HH:mm:ss" withFormate:@"MM/DD/YYYY HH:mm:ss"];
|
|
|
++ (NSString *)changeDateTimeFormate:(NSString *)dateTime {
|
|
|
+ return [self changeDateTime:dateTime Formate:@"yyyy-MM-dd HH:mm:ss" withFormate:@"MM/dd/yyyy HH:mm:ss"];
|
|
|
// return [self timeFormat:dateTime from:@"YYYY-MM-DD HH:mm:ss" to:@"MM/DD/YYYY HH:mm:ss"];
|
|
|
}
|
|
|
|
|
|
@@ -4254,7 +4243,7 @@
|
|
|
if(create_time==nil)
|
|
|
create_time= "";
|
|
|
NSString *nscreate_time= [[NSString alloc]initWithUTF8String:create_time];
|
|
|
- nscreate_time = [self changeDateTime:nscreate_time];// 与在线统一
|
|
|
+ nscreate_time = [self changeDateTimeFormate:nscreate_time];// 与在线统一
|
|
|
|
|
|
int status = sqlite3_column_int(statement, 4);
|
|
|
NSString* nsstatus=@"";
|
|
|
@@ -4597,6 +4586,8 @@
|
|
|
keyword = [self translateSingleQuote:keyword]; // 转义单引号
|
|
|
NSString *orderStatus = [params valueForKey:@"orderStatus"];
|
|
|
|
|
|
+ NSString *contactID = [self valueInParams:params key:@"contactId"]; // 新建order时会多一个contactId,此时status = 0
|
|
|
+
|
|
|
NSString* where=@"1 = 1";
|
|
|
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]];
|
|
|
@@ -4615,6 +4606,12 @@
|
|
|
}
|
|
|
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:@" )"];
|
|
|
}
|
|
|
}
|
|
|
@@ -4668,7 +4665,7 @@
|
|
|
if(create_time==nil)
|
|
|
create_time= "";
|
|
|
NSString *nscreate_time= [[NSString alloc]initWithUTF8String:create_time];
|
|
|
- nscreate_time = [self changeDateTime:nscreate_time]; // 与在线统一
|
|
|
+ nscreate_time = [self changeDateTimeFormate:nscreate_time]; // 与在线统一
|
|
|
|
|
|
double total_price = sqlite3_column_double(statement, 7);
|
|
|
|