openlockPPP il y a 8 mois
Parent
commit
3d44075c95

+ 4 - 4
JiaPeiManage.xcodeproj/project.pbxproj

@@ -1660,7 +1660,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_ENTITLEMENTS = JiaPeiManage/JiaPeiManage.entitlements;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1262024040801;
+				CURRENT_PROJECT_VERSION = 1272024040808;
 				DEVELOPMENT_TEAM = K7T6CU5SW5;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = JiaPeiManage/Info.plist;
@@ -1682,7 +1682,7 @@
 					"$(inherited)",
 					"$(SDKROOT)/usr/lib/swift",
 				);
-				MARKETING_VERSION = 1.2.6;
+				MARKETING_VERSION = 1.2.7;
 				PRODUCT_BUNDLE_IDENTIFIER = com.kestrel.JSJPCoach;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@@ -1703,7 +1703,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_ENTITLEMENTS = JiaPeiManage/JiaPeiManage.entitlements;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1262024040801;
+				CURRENT_PROJECT_VERSION = 1272024040808;
 				DEVELOPMENT_TEAM = K7T6CU5SW5;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = JiaPeiManage/Info.plist;
@@ -1725,7 +1725,7 @@
 					"$(inherited)",
 					"$(SDKROOT)/usr/lib/swift",
 				);
-				MARKETING_VERSION = 1.2.6;
+				MARKETING_VERSION = 1.2.7;
 				PRODUCT_BUNDLE_IDENTIFIER = com.kestrel.JSJPCoach;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";

+ 22 - 0
JiaPeiManage/Sources/Constants/NYMacros.swift

@@ -151,6 +151,28 @@ struct NYDate {
         let endDateString = dateFormatter.string(from: endDate)
         return [startDateString,endDateString]
     }
+    //获取n月 str
+    static func getMonthStartAndEndDates(forMonth month: String) -> [String] {
+        let dateFormatter = DateFormatter()
+        dateFormatter.dateFormat = "yyyy-MM"
+
+        guard let date = dateFormatter.date(from: month) else {
+            return []
+        }
+
+        let calendar = Calendar.current
+        let components = calendar.dateComponents([.year, .month], from: date)
+
+        guard let startDate = calendar.date(from: components),
+              let endDate = calendar.date(byAdding: DateComponents(month: 1, day: -1), to: startDate) else {
+            return []
+        }
+        dateFormatter.dateFormat = "yyyy-MM-dd"
+        let startDateString = dateFormatter.string(from: startDate)
+        let endDateString = dateFormatter.string(from: endDate)
+        return [startDateString, endDateString]
+    }
+
     //获取本年
     static func getDateYear()-> [String] {
         let calendar = Calendar.current

+ 7 - 2
JiaPeiManage/Sources/Modulars/Statistics/Controllers/StatisticsStuListPageController.swift

@@ -55,8 +55,13 @@ final class StatisticsStuListPageController: BaseTableViewController {
                 startDate = dateTime_str
                 endDate = dateTime_str
             case 5://月
-                startDate = dateTime_str + "-01"
-                endDate = dateTime_str + "-31"
+                //月份判断
+                let components = dateTime_str.components(separatedBy: "-")
+                if components.count >= 2 {
+                    let dates = NYDate.getMonthStartAndEndDates(forMonth: dateTime_str)
+                    startDate = dates[0]
+                    endDate = dates[1]
+                }
             case 6://年
                 startDate = dateTime_str + "-01-01"
                 endDate = dateTime_str + "-12-31"

+ 1 - 1
JiaPeiManage/Sources/Modulars/Statistics/ViewModel/StatisticsStuListViewModel.swift

@@ -246,7 +246,7 @@ class StatisticsStuListViewModel: NSObject {
                         self.rows += traineeDataModel.rows!
                     }
                     itemsSubject.onNext(self.rows)//消息rx
-                    print("coachInfoListRequest成功")
+                    print("coachInfoListDateRequest成功")
     //                vc.tableView.reloadData()
                     vc.stopLoad()
                 }, onError: { error in

+ 2 - 1
JiaPeiManage/Sources/Modulars/二维码/Controllers/CoachQRPageController.swift

@@ -62,8 +62,9 @@ final class CoachQRPageController: BaseViewController {
 //            } catch {
 //                print("Failed to encode CoachJsonInfo object:", error)
 //            }
+            
             let content = "#FJCOACH#@@\(coachJsonInfo.id)@@"+coachJsonInfo.dqbh
-            let result = "#DECODE#"+DES3Util.encrypt(content)
+            let result = "\(LocalManager.qr_dwanload_url)?text=#DECODE#"+DES3Util.encrypt(content)
             self.qrcode_imageView.image = UIImage.generateQRCode(from: result, size: CGSize(width: 124.f, height: 124.f))
             NYTips.hide()
         }, onError: { error in

+ 4 - 0
JiaPeiManage/Sources/Utils/LocalManager.swift

@@ -16,6 +16,8 @@ class LocalManager {
     static let loginService: LoginServiceType = LoginService(networking: LoginNetworking())
     //本地用户信息
     static var userInfo: UserInfo = UserInfo()
+    //下载地址
+    static var qr_dwanload_url = ""
     //清理
     class func clearUserInfo() {
         
@@ -65,6 +67,8 @@ class LocalManager {
                     LocalManager.userInfo.server_version =  cityItem.dictValue.replacingOccurrences(of: ".", with: "")
                 }else if cityItem.dictLabel == "ios_login_open" {
                     LocalManager.userInfo.ios_login_open = Int(cityItem.dictValue)
+                }else if cityItem.dictLabel == "qr_app_download" {
+                    LocalManager.qr_dwanload_url = cityItem.dictValue
                 }
             }
         },onError: { Error in