From 69b713ac3329ddd3fad4617e30061676829f9c9c Mon Sep 17 00:00:00 2001
From: liumiao <495261512@qq.com>
Date: 星期二, 02 二月 2021 11:42:59 +0800
Subject: [PATCH] 根据学员获取课次

---
 app/Http/Controllers/Api/v1/ClassScheduleController.php |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/app/Http/Controllers/Api/v1/ClassScheduleController.php b/app/Http/Controllers/Api/v1/ClassScheduleController.php
index 45aa6ad..7fd17c1 100644
--- a/app/Http/Controllers/Api/v1/ClassScheduleController.php
+++ b/app/Http/Controllers/Api/v1/ClassScheduleController.php
@@ -434,6 +434,13 @@
         $mapList = [];
         foreach($list as $val)
         {
+            $contentTime = explode('-', $val["contentTime"]);
+            //鍒ゆ柇缁撹浠ュ悗鐨勭彮绾т笉鍦ㄥ睍绀烘暟鎹�
+            if(!empty($val["endTime"]) && $val["startTime"] . " " . $contentTime[0] . ":00" > $val['endTime'] && $val['classstatus'] == 2)
+            {
+                continue;
+            }
+
             //鐝骇浜烘暟
             $classStudentsNum = !empty($students[$val["classCode"]]) ? count($students[$val["classCode"]]) : 0;
             $signIn = !empty($faceList[$val["classCode"] . "-" . $val["classNumber"] . "-" . $val["contentTime"]]) ? count($faceList[$val["classCode"] . "-" . $val["classNumber"] . "-" . $val["contentTime"]]) : 0; //浜鸿劯绛惧埌
@@ -470,14 +477,9 @@
             $val["numTypes"] = $actualNum . "/" . $leaveNum . "/" . $signIn . "/" . $classStudentsNum;//鍑哄嫟/璇峰亣/浜鸿劯/搴斿埌
             $val["remind"] = 0;//浠e姙鎻愰啋
             $val["courseName"] = !empty($courseMap[$val["classCode"]]) ? $courseMap[$val["classCode"]] : '';//璇剧▼鍚嶅瓧
-            $contentTime = explode('-', $val["contentTime"]);
             $val["startContentTime"] = $contentTime[0];
             $val["endContentTime"] = $contentTime[1];
             $dayTime = explode('-', $val["startTime"]);
-            if(!empty($val["endTime"]) && $val["startTime"] . " " . $contentTime[0] . ":00" > $val['endTime'] && $val['classstatus'] == 2)
-            {
-                continue;
-            }
             $mapList[(int)$dayTime[2]][] = $val;
         }
         return $this->_response($mapList);

--
Gitblit v1.8.0