liumiao
2021-01-20 b6c9593f1b818b3f07d5f82e216fc6d941c1d6b1
学员号
1 files modified
27 ■■■■■ changed files
app/Http/Controllers/Api/v1/ClassScheduleController.php 27 ●●●●● patch | view | raw | blame | history
app/Http/Controllers/Api/v1/ClassScheduleController.php
@@ -106,7 +106,32 @@
                "classCode" => $classCode,
                "username" => $username,
            ];
            AttendRecordModel::updateRecordMass($data, $where);
            $info = AttendRecordModel::findRecordOneCondition($where);
            if($info)
            {
                AttendRecordModel::updateRecordMass($data, $where);
            }
            else
            {
                $info = CourseTableModel::findRecordOneCondition(["id" => $courseTableId]);
                $addData = [
                    "courseTableId" => $courseTableId,
                    "orgId" => $info["orgId"],
                    "staffId" => $info["staffId"],
                    "username" => $username,
                    "classNumber" => $classNumber,
                    "classHour" => $classHour,
                    "className" => $info["className"],
                    "classCode" => $classCode,
                    "sectionid" => $info["sectionid"],
                    "remark" => $remark,
                    "updateTime" => date("Y-m-d H:i:s"),
                    "classStatus" => $classStatus,
                ];
                AttendRecordModel::addRecord($addData);
            }
        }
        return $this->_response();