浏览代码

统计月份-默认一年,调整修护bug

openlockPPP 1 年之前
父节点
当前提交
8a9936b901
共有 27 个文件被更改,包括 121 次插入75 次删除
  1. 20 8
      JiaPeiManage.xcodeproj/project.pbxproj
  2. 二进制
      JiaPeiManage/Assets.xcassets/AppIcon.appiconset/App Store.png
  3. 二进制
      JiaPeiManage/Assets.xcassets/AppIcon.appiconset/iPhone App Icon iOS 5,6.png
  4. 二进制
      JiaPeiManage/Assets.xcassets/AppIcon.appiconset/iPhone App Icon iOS 5,6@2x.png
  5. 二进制
      JiaPeiManage/Assets.xcassets/AppIcon.appiconset/iPhone App Icon iOS 7,12@2x.png
  6. 二进制
      JiaPeiManage/Assets.xcassets/AppIcon.appiconset/iPhone App Icon iOS 7,12@3x.png
  7. 二进制
      JiaPeiManage/Assets.xcassets/AppIcon.appiconset/iPhone Spotlight iOS 5,6 & Settings.png
  8. 二进制
      JiaPeiManage/Assets.xcassets/AppIcon.appiconset/iPhone Spotlight iOS 5,6 & Settings@2x.png
  9. 二进制
      JiaPeiManage/Assets.xcassets/AppIcon.appiconset/iPhone Spotlight iOS 5,6 & Settings@3x.png
  10. 二进制
      JiaPeiManage/Assets.xcassets/AppIcon.appiconset/iPhone Spotlight iOS 7,12@2x.png
  11. 二进制
      JiaPeiManage/Assets.xcassets/AppIcon.appiconset/iPhone Spotlight iOS 7,12@3x.png
  12. 二进制
      JiaPeiManage/Assets.xcassets/AppIcon.appiconset/iPhone notification iOS 7,12@2x.png
  13. 二进制
      JiaPeiManage/Assets.xcassets/AppIcon.appiconset/iPhone notification iOS 7,12@3x.png
  14. 二进制
      JiaPeiManage/Assets.xcassets/AppIcon_NewRule.appiconset/1024.png
  15. 二进制
      JiaPeiManage/Assets.xcassets/AppIcon_NewRule.appiconset/120-1.png
  16. 二进制
      JiaPeiManage/Assets.xcassets/AppIcon_NewRule.appiconset/120.png
  17. 二进制
      JiaPeiManage/Assets.xcassets/AppIcon_NewRule.appiconset/180.png
  18. 二进制
      JiaPeiManage/Assets.xcassets/AppIcon_NewRule.appiconset/40.png
  19. 二进制
      JiaPeiManage/Assets.xcassets/AppIcon_NewRule.appiconset/58.png
  20. 二进制
      JiaPeiManage/Assets.xcassets/AppIcon_NewRule.appiconset/60.png
  21. 二进制
      JiaPeiManage/Assets.xcassets/AppIcon_NewRule.appiconset/80.png
  22. 二进制
      JiaPeiManage/Assets.xcassets/AppIcon_NewRule.appiconset/87.png
  23. 0 62
      JiaPeiManage/Assets.xcassets/AppIcon_NewRule.appiconset/Contents.json
  24. 6 1
      JiaPeiManage/Sources/Modulars/Statistics/Controllers/StatisticsPageController.swift
  25. 88 0
      JiaPeiManage/Sources/Modulars/Statistics/ViewModel/StatisticsPageViewModel.swift
  26. 4 1
      JiaPeiManage/Sources/Modulars/Statistics/Views/StatisticsSelectDateView.swift
  27. 3 3
      JiaPeiManage/Sources/Modulars/学员/ViewModel/MeTraineeSubjectViewModel.swift

+ 20 - 8
JiaPeiManage.xcodeproj/project.pbxproj

@@ -73,6 +73,7 @@
 		909DA5D52A3AE0160034501F /* MeTraineeSubjectCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 909DA5D42A3AE0160034501F /* MeTraineeSubjectCell.xib */; };
 		90A8CD462A5E763E00C02402 /* MeTraineeSearchViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90A8CD452A5E763E00C02402 /* MeTraineeSearchViewModel.swift */; };
 		90A8CD482A5EACB500C02402 /* MeTraineeSubjectViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90A8CD472A5EACB500C02402 /* MeTraineeSubjectViewModel.swift */; };
+		90A8CD4B2A5F9EE000C02402 /* StatisticsPageViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90A8CD4A2A5F9EE000C02402 /* StatisticsPageViewModel.swift */; };
 		90BC4BD92A3B0F98006FD683 /* TraineeDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90BC4BD82A3B0F98006FD683 /* TraineeDataModel.swift */; };
 		90BC4BDC2A3C2556006FD683 /* TVHeaderAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90BC4BDB2A3C2556006FD683 /* TVHeaderAnimator.swift */; };
 		90BC4BDE2A3C4691006FD683 /* MeTraineeDetailsPageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90BC4BDD2A3C4691006FD683 /* MeTraineeDetailsPageViewController.swift */; };
@@ -251,6 +252,7 @@
 		909DA5D42A3AE0160034501F /* MeTraineeSubjectCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MeTraineeSubjectCell.xib; sourceTree = "<group>"; };
 		90A8CD452A5E763E00C02402 /* MeTraineeSearchViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeTraineeSearchViewModel.swift; sourceTree = "<group>"; };
 		90A8CD472A5EACB500C02402 /* MeTraineeSubjectViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeTraineeSubjectViewModel.swift; sourceTree = "<group>"; };
+		90A8CD4A2A5F9EE000C02402 /* StatisticsPageViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatisticsPageViewModel.swift; sourceTree = "<group>"; };
 		90BC4BD82A3B0F98006FD683 /* TraineeDataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TraineeDataModel.swift; sourceTree = "<group>"; };
 		90BC4BDB2A3C2556006FD683 /* TVHeaderAnimator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TVHeaderAnimator.swift; sourceTree = "<group>"; };
 		90BC4BDD2A3C4691006FD683 /* MeTraineeDetailsPageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeTraineeDetailsPageViewController.swift; sourceTree = "<group>"; };
@@ -519,6 +521,7 @@
 		90971E702A498A2000267B7F /* Statistics */ = {
 			isa = PBXGroup;
 			children = (
+				90A8CD492A5F97DB00C02402 /* ViewModel */,
 				90971E712A498A3700267B7F /* Views */,
 				90971E722A498A3E00267B7F /* Controllers */,
 			);
@@ -580,6 +583,14 @@
 			path = ViewModel;
 			sourceTree = "<group>";
 		};
+		90A8CD492A5F97DB00C02402 /* ViewModel */ = {
+			isa = PBXGroup;
+			children = (
+				90A8CD4A2A5F9EE000C02402 /* StatisticsPageViewModel.swift */,
+			);
+			path = ViewModel;
+			sourceTree = "<group>";
+		};
 		90BC4BDA2A3C2541006FD683 /* RefreshHeaderAnimation */ = {
 			isa = PBXGroup;
 			children = (
@@ -1237,6 +1248,7 @@
 				90CE53042A3834360033BD06 /* CoachService.swift in Sources */,
 				908FEEA52A42D62A00BEB81C /* StuTmsSignDataModel.swift in Sources */,
 				90BC4BDE2A3C4691006FD683 /* MeTraineeDetailsPageViewController.swift in Sources */,
+				90A8CD4B2A5F9EE000C02402 /* StatisticsPageViewModel.swift in Sources */,
 				90CE52CB2A36E5EC0033BD06 /* UILabel+Rx.swift in Sources */,
 				90CE52E12A36E73A0033BD06 /* SplashModel.swift in Sources */,
 				90C9C5592A4C7B45006D3921 /* Notification+NY.swift in Sources */,
@@ -1452,10 +1464,10 @@
 			isa = XCBuildConfiguration;
 			baseConfigurationReference = A8171123E8F401C7CF842A4C /* Pods-JiaPeiManage.debug.xcconfig */;
 			buildSettings = {
-				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon_NewRule;
+				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1;
+				CURRENT_PROJECT_VERSION = 1202023071301;
 				DEVELOPMENT_TEAM = K7T6CU5SW5;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = JiaPeiManage/Info.plist;
@@ -1475,8 +1487,8 @@
 					"$(inherited)",
 					"$(SDKROOT)/usr/lib/swift",
 				);
-				MARKETING_VERSION = 1.0.1;
-				PRODUCT_BUNDLE_IDENTIFIER = zhongZheng.com.jsmanage.JiaPeiManage;
+				MARKETING_VERSION = 1.2.0;
+				PRODUCT_BUNDLE_IDENTIFIER = com.kestrel.JSJPCoach;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_EMIT_LOC_STRINGS = YES;
 				SWIFT_OBJC_BRIDGING_HEADER = "${SRCROOT}/JiaPeiManage/JSJP-Brigding-Header.h";
@@ -1489,10 +1501,10 @@
 			isa = XCBuildConfiguration;
 			baseConfigurationReference = D9F65764266FE5C95D1940F5 /* Pods-JiaPeiManage.release.xcconfig */;
 			buildSettings = {
-				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon_NewRule;
+				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1;
+				CURRENT_PROJECT_VERSION = 1202023071301;
 				DEVELOPMENT_TEAM = K7T6CU5SW5;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = JiaPeiManage/Info.plist;
@@ -1512,8 +1524,8 @@
 					"$(inherited)",
 					"$(SDKROOT)/usr/lib/swift",
 				);
-				MARKETING_VERSION = 1.0.1;
-				PRODUCT_BUNDLE_IDENTIFIER = zhongZheng.com.jsmanage.JiaPeiManage;
+				MARKETING_VERSION = 1.2.0;
+				PRODUCT_BUNDLE_IDENTIFIER = com.kestrel.JSJPCoach;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_EMIT_LOC_STRINGS = YES;
 				SWIFT_OBJC_BRIDGING_HEADER = "${SRCROOT}/JiaPeiManage/JSJP-Brigding-Header.h";

二进制
JiaPeiManage/Assets.xcassets/AppIcon.appiconset/App Store.png


二进制
JiaPeiManage/Assets.xcassets/AppIcon.appiconset/iPhone App Icon iOS 5,6.png


二进制
JiaPeiManage/Assets.xcassets/AppIcon.appiconset/iPhone App Icon iOS 5,6@2x.png


二进制
JiaPeiManage/Assets.xcassets/AppIcon.appiconset/iPhone App Icon iOS 7,12@2x.png


二进制
JiaPeiManage/Assets.xcassets/AppIcon.appiconset/iPhone App Icon iOS 7,12@3x.png


二进制
JiaPeiManage/Assets.xcassets/AppIcon.appiconset/iPhone Spotlight iOS 5,6 & Settings.png


二进制
JiaPeiManage/Assets.xcassets/AppIcon.appiconset/iPhone Spotlight iOS 5,6 & Settings@2x.png


二进制
JiaPeiManage/Assets.xcassets/AppIcon.appiconset/iPhone Spotlight iOS 5,6 & Settings@3x.png


二进制
JiaPeiManage/Assets.xcassets/AppIcon.appiconset/iPhone Spotlight iOS 7,12@2x.png


二进制
JiaPeiManage/Assets.xcassets/AppIcon.appiconset/iPhone Spotlight iOS 7,12@3x.png


二进制
JiaPeiManage/Assets.xcassets/AppIcon.appiconset/iPhone notification iOS 7,12@2x.png


二进制
JiaPeiManage/Assets.xcassets/AppIcon.appiconset/iPhone notification iOS 7,12@3x.png


二进制
JiaPeiManage/Assets.xcassets/AppIcon_NewRule.appiconset/1024.png


二进制
JiaPeiManage/Assets.xcassets/AppIcon_NewRule.appiconset/120-1.png


二进制
JiaPeiManage/Assets.xcassets/AppIcon_NewRule.appiconset/120.png


二进制
JiaPeiManage/Assets.xcassets/AppIcon_NewRule.appiconset/180.png


二进制
JiaPeiManage/Assets.xcassets/AppIcon_NewRule.appiconset/40.png


二进制
JiaPeiManage/Assets.xcassets/AppIcon_NewRule.appiconset/58.png


二进制
JiaPeiManage/Assets.xcassets/AppIcon_NewRule.appiconset/60.png


二进制
JiaPeiManage/Assets.xcassets/AppIcon_NewRule.appiconset/80.png


二进制
JiaPeiManage/Assets.xcassets/AppIcon_NewRule.appiconset/87.png


+ 0 - 62
JiaPeiManage/Assets.xcassets/AppIcon_NewRule.appiconset/Contents.json

@@ -1,62 +0,0 @@
-{
-  "images" : [
-    {
-      "filename" : "40.png",
-      "idiom" : "iphone",
-      "scale" : "2x",
-      "size" : "20x20"
-    },
-    {
-      "filename" : "60.png",
-      "idiom" : "iphone",
-      "scale" : "3x",
-      "size" : "20x20"
-    },
-    {
-      "filename" : "58.png",
-      "idiom" : "iphone",
-      "scale" : "2x",
-      "size" : "29x29"
-    },
-    {
-      "filename" : "87.png",
-      "idiom" : "iphone",
-      "scale" : "3x",
-      "size" : "29x29"
-    },
-    {
-      "filename" : "80.png",
-      "idiom" : "iphone",
-      "scale" : "2x",
-      "size" : "40x40"
-    },
-    {
-      "filename" : "120.png",
-      "idiom" : "iphone",
-      "scale" : "3x",
-      "size" : "40x40"
-    },
-    {
-      "filename" : "120-1.png",
-      "idiom" : "iphone",
-      "scale" : "2x",
-      "size" : "60x60"
-    },
-    {
-      "filename" : "180.png",
-      "idiom" : "iphone",
-      "scale" : "3x",
-      "size" : "60x60"
-    },
-    {
-      "filename" : "1024.png",
-      "idiom" : "ios-marketing",
-      "scale" : "1x",
-      "size" : "1024x1024"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

+ 6 - 1
JiaPeiManage/Sources/Modulars/Statistics/Controllers/StatisticsPageController.swift

@@ -20,6 +20,9 @@ final class StatisticsPageController: BaseGroupTableViewController {
     let cellIdentifier:String = "_StatisticsPageCell"
     // MARK: 服务属性
     private let statisticsService: StatisticsServiceType = StatisticsService(networking: StatisticsNetworking())
+    //VM
+    let statisticsPageViewModel = StatisticsPageViewModel()
+    
     // MARK: UI let
     let statusBar = UIView().then {
         $0.backgroundColor = UIColor.db_theme
@@ -189,7 +192,7 @@ final class StatisticsPageController: BaseGroupTableViewController {
             self.endDate = dates[1]
             self.startDate = dates[0]
         case .month:
-            let dates = NYDate.getDateMonthSectionNum(num: -2)
+            let dates = NYDate.getDateYear() //本年 NYDate.getDateMonthSectionNum(num: -2)
             self.endDate =  String(dates[1].prefix(7))
             self.startDate =  String(dates[0].prefix(7))
         case .year:
@@ -267,6 +270,7 @@ final class StatisticsPageController: BaseGroupTableViewController {
                             self?.dateType = dateType
                             self?.configDefaulthDate()
                             self?.configUIdata()
+                            self?.selectDateView.showCount = 0
                             self?.switchStatisticsStuCount()
                             print("datetype = \(dateType)")
                         })
@@ -376,6 +380,7 @@ final class StatisticsPageController: BaseGroupTableViewController {
         setupRefreshHeader(tableView) {[unowned self] in
             self.getStatisticsList(isLoading: false)
         }
+        self.isEmptyDisplay = false
     }
     
 

+ 88 - 0
JiaPeiManage/Sources/Modulars/Statistics/ViewModel/StatisticsPageViewModel.swift

@@ -0,0 +1,88 @@
+//
+//  StatisticsPageViewModel.swift
+//  JiaPeiManage
+//
+//  Created by Ning.ge on 2023/7/13.
+//
+
+import UIKit
+import RxSwift
+
+class StatisticsPageViewModel: NSObject {
+    
+    // MARK: 服务属性
+    private let statisticsService: StatisticsServiceType = StatisticsService(networking: StatisticsNetworking())
+    
+    private let itemsSubject = BehaviorSubject<[StuCountInfoModel]>(value: [])
+        
+    var items: Observable<[StuCountInfoModel]> {
+        return itemsSubject.asObservable()
+    }
+    
+    
+    override init() {
+        super.init()
+    }
+    
+    //获取统计报名
+    func getStatisticsList(isLoading:Bool){
+//        if isLoading {NYTips.show()}
+//        self.statisticsService.statisticsStuCount(city: LocalManager.userInfo.city!, schoolId: LocalManager.userInfo.schoolId).subscribe(onSuccess: {[unowned self] stuTotalCountDataModel in
+//                print("成功%@",stuTotalCountDataModel)
+//                self.stuTotalCountDataModel = stuTotalCountDataModel
+//
+//                self.statisticsService.everyDayStuCountRequest(city: LocalManager.userInfo.city!, schoolId: LocalManager.userInfo.schoolId, startDate: self.startDate, endDate: self.endDate, fieldType: self.fieldType,sortType: self.sortType).subscribe(onSuccess: { stuCountDataModel in
+//                        self.stuCountDataModel = stuCountDataModel
+//                        self.hideLoadAnimation()
+//                        self.tableView.reloadData()
+//                        self.stopRefresh()
+//                        NYTips.hide()
+//                    }, onError: { error in
+//                        self.stopRefresh()
+//                        NYTips.hide()
+//                    })
+//                    .disposed(by: disposeBag)
+//            }, onError: { error in
+//                self.stopRefresh()
+//                NYTips.hide()
+//            })
+//            .disposed(by: disposeBag)
+    }
+    
+    //切换
+    func switchStatisticsStuCount(){
+//        // 根据不同的 dateType 进行相应的数据请求
+//        switch dateType {
+//        case .day:
+//            // 发起请求,获取日数据
+//            self.statisticsService.everyDayStuCountRequest(city: LocalManager.userInfo.city!, schoolId: LocalManager.userInfo.schoolId, startDate: self.startDate, endDate: self.endDate, fieldType: self.fieldType,sortType: self.sortType).subscribe(onSuccess: { stuCountDataModel in
+//                    self.stuCountDataModel = stuCountDataModel
+//                    self.tableView.reloadData()
+//                }, onError: { error in
+//                })
+//                .disposed(by: disposeBag)
+//        case .month:
+//            // 发起请求,获取月数据
+//            let startMonth = String(self.startDate.prefix(7))
+//            let endMonth =  String(self.endDate.prefix(7))
+//            self.statisticsService.everyMonthStuCount(city: LocalManager.userInfo.city!, schoolId: LocalManager.userInfo.schoolId, startMonth: startMonth, endMonth: endMonth, fieldType: self.fieldType,sortType: self.sortType).subscribe(onSuccess: { stuCountDataModel in
+//                    self.stuCountDataModel = stuCountDataModel
+//                    self.tableView.reloadData()
+//                }, onError: { error in
+//                })
+//                .disposed(by: disposeBag)
+//        case .year:
+//            // 发起请求,获取年数据
+//            let startYear = String(self.startDate.prefix(4))
+//            let endYear =  String(self.endDate.prefix(4))
+//            self.statisticsService.everyYearStuCount(city: LocalManager.userInfo.city!, schoolId: LocalManager.userInfo.schoolId, startYear: startYear, endYear: endYear, fieldType: self.fieldType,sortType: self.sortType).subscribe(onSuccess: { stuCountDataModel in
+//                    self.stuCountDataModel = stuCountDataModel
+//                    self.tableView.reloadData()
+//                }, onError: { error in
+//                })
+//                .disposed(by: disposeBag)
+//        }
+
+    }
+    
+}

+ 4 - 1
JiaPeiManage/Sources/Modulars/Statistics/Views/StatisticsSelectDateView.swift

@@ -30,6 +30,7 @@ final class StatisticsSelectDateView: UIView,NibLoadable {
     var startDate:String = ""
     var endDate:String = ""
     var selectIndex = 0
+    var showCount = 0 //show的次数
     override func awakeFromNib() {
         super.awakeFromNib()
         //本月
@@ -45,6 +46,7 @@ final class StatisticsSelectDateView: UIView,NibLoadable {
     //日月年
     func setDateType(type:DateType){
         dateType = type
+        if showCount>=1 {return}
         switch dateType {
         case .day:
             month_button.setTitle("昨日", for: .normal)
@@ -60,7 +62,7 @@ final class StatisticsSelectDateView: UIView,NibLoadable {
             threemonth_button.setTitle("近3月", for: .normal)
             year_button.setTitle("本年", for: .normal)
             current_button.backgroundColor = UIColor("#0B2B4D")!
-            current_button = threemonth_button
+            current_button = year_button
             current_button.backgroundColor = UIColor("#597CA1")!
         case .year:
             month_button.setTitle("本年", for: .normal)
@@ -71,6 +73,7 @@ final class StatisticsSelectDateView: UIView,NibLoadable {
             current_button = year_button
             current_button.backgroundColor = UIColor("#597CA1")!
         }
+        showCount+=1
     }
     //选中 - func
     func selectItemIndex(index:Int){

+ 3 - 3
JiaPeiManage/Sources/Modulars/学员/ViewModel/MeTraineeSubjectViewModel.swift

@@ -46,7 +46,7 @@ class MeTraineeSubjectViewModel: NSObject {
                     print("coachInfoListRequest成功")
                     vc.isEmptyDisplay = true
                     vc.hideLoadAnimation()
-//                    vc.tableView.reloadData()
+                    vc.tableView.reloadData()
                     vc.stopRefresh()
                 }, onError: { error in
                     vc.stopRefresh()
@@ -64,7 +64,7 @@ class MeTraineeSubjectViewModel: NSObject {
                     print("coachInfoListRequest成功")
                     vc.isEmptyDisplay = true
                     vc.hideLoadAnimation()
-//                    vc.tableView.reloadData()
+                    vc.tableView.reloadData()
                     vc.stopRefresh()
                     NotificationCenter.default.post(name: Notification.updateItemTopTotalNameNotification, object: [traineeDataModel.total,Int(self.state)!-1])
                 }, onError: { error in
@@ -82,7 +82,7 @@ class MeTraineeSubjectViewModel: NSObject {
                 print("coachInfoListRequest成功")
                 vc.isEmptyDisplay = true
                 vc.hideLoadAnimation()
-//                vc.tableView.reloadData()
+                vc.tableView.reloadData()
                 vc.stopRefresh()
                 NotificationCenter.default.post(name: Notification.updateItemTopTotalNameNotification, object: [traineeDataModel.total,Int(self.state)!-1])
             }, onError: { error in