//
//  searchViewModel.m
//  Open
//
//  Created by 看看智能 on 2017/11/30.
//  Copyright © 2017年 黄江涛 . All rights reserved.
//

#import "searchViewModel.h"

@implementation searchViewModel
-(NSMutableArray *)arrayForNews
{
    if (!_arrayForNews) {
        _arrayForNews =[NSMutableArray new];
        [_arrayForNews removeAllObjects];
    }
    return _arrayForNews;
}

- (void)getDataFromName:(NSString *)name andID:(NSString*)ID NetCompleteHandle:(CompletionHandle)completionHandle{
    //雷俊博注释
//    [SearchProgressNet verifyProgress:name andID:ID Handle:^(SearchProgress *model, NSError *error) {
//        self.location = 0;
//        self.type =0;
//        self.codeZ =model.code;
//
//        completionHandle(error);
//
//
//    }];
    
    
    //雷俊博重写
    NSDictionary *params =@{
                             @"identityNumber": ID,
                             @"name":name
                             };
    WeakSelf
    [SearchProgressNet obtainverifyProgressWithParams:params Handle:^(SSRecordModel *model, NSError *error) {
        weakSelf.location = 0;
        weakSelf.type = 0;
        weakSelf.codeZ = model.code;
        weakSelf.model = model.result;
        completionHandle(error);
        
    }];
}
////处理数组
//-(NSInteger )modelForRows:(NSInteger)row{
//    if (self.dataArr.count  >0) {
//        return self.dataArr[row];
//    }else{
//        [SVProgressHUD showErrorWithStatus:@"网络信号差"];
//        return nil;
//    }
//}
//-(NSString *)titleForRow:(NSInteger)row
//{
//    return [self modelForRows:row].name;
//}
//-(NSString *)IDForRow:(NSInteger)row
//{
//    return [self modelForRows:row].identityNumber;
//}

@end
