diff --git a/XFFruit/ViewControllers/Survey/controllers/SurveyViewController.m b/XFFruit/ViewControllers/Survey/controllers/SurveyViewController.m index 0179844870882ca6a5c6816b7bd644defb6453b7..ef2b5a6d16c95df78584402ac6956ba18b80dc08 100644 --- a/XFFruit/ViewControllers/Survey/controllers/SurveyViewController.m +++ b/XFFruit/ViewControllers/Survey/controllers/SurveyViewController.m @@ -83,30 +83,52 @@ typedef enum : NSUInteger { [IBTLoadingView showProgressLabel:@"æ£åœ¨åŠ è½½..."]; ICRUserUtil *userUtil = [ICRUserUtil sharedInstance]; + id orderFieldObject = [NSNull null]; + NSString *firstOrder = @""; + id orderObject = [NSNull null]; + NSMutableArray *orderArr =[NSMutableArray array]; + if (self.orderDirection.length > 0) { + orderObject = self.orderDirection; + firstOrder = @"lastModified"; + [orderArr addObject:@"lastModified"]; + } id billObject = [NSNull null]; if (self.billNumberLike.length > 0) { billObject = self.billNumberLike; + if ([firstOrder isEqualToString: @"lastModified"]) { + [orderArr addObject:@"billNumber"]; + } } id stateObject = [NSNull null]; if (self.state.length > 0 && ![self.state isEqualToString:@"none"]) { stateObject = self.state; + if ([firstOrder isEqualToString: @"lastModified"]) { + [orderArr addObject:@"state"]; + } } id titleObject = [NSNull null]; if (self.titleLike.length > 0) { titleObject = self.titleLike; - } - id orderObject = [NSNull null]; - if (self.orderDirection.length > 0) { - orderObject = self.orderDirection; + if ([firstOrder isEqualToString: @"lastModified"]) { + [orderArr addObject:@"title"]; + } } + if (orderArr.count > 0) { + NSString *str = @""; + for (NSString *order in orderArr) { + str = [str stringByAppendingFormat:@"%@,",order]; + } + orderFieldObject = str; + } + NSLog(@"%@",orderFieldObject); NSDictionary *dict = @{ @"billNumberLike":billObject, @"state":stateObject, @"titleLike":titleObject, @"orderField":[NSNull null], @"orderDirection":orderObject, -// @"userUuid":userUtil.userId, + @"userUuid":userUtil.userId, @"pageNumber":@(0), @"pageSize":@(20)}; [[ICRHTTPController sharedController] querySurveyWithBillData:dict success:succ failure:fail];