|
@@ -612,7 +612,10 @@ func InsertBatchUserByTermId(file multipart.File, termId, classId int) *result.R
|
|
|
}
|
|
|
}
|
|
|
fmt.Println()
|
|
|
- if roleName == "student" && class.TermId != termId || (classId != 0 && class.Id != nil && *class.Id == classId) {
|
|
|
+ // !TODO 注释为之前的 选择班级不能导入的问题
|
|
|
+ // if roleName == "student" && class.TermId != termId || (classId != 0 && class.Id != nil && *class.Id == classId) {
|
|
|
+ if roleName == "student" && class.TermId != termId || (classId != 0 && class.Id != nil && *class.Id != classId) {
|
|
|
+ fmt.Println(111)
|
|
|
continue
|
|
|
}
|
|
|
|
|
@@ -682,6 +685,10 @@ func InsertBatchUserByTermId(file multipart.File, termId, classId int) *result.R
|
|
|
if err != nil && err != sql.ErrNoRows {
|
|
|
return result.UNKNOW_ERROR.SetMsg(err.Error())
|
|
|
}
|
|
|
+ // !TODO 修复count为nil时报错
|
|
|
+ if count == nil {
|
|
|
+ continue
|
|
|
+ }
|
|
|
|
|
|
// 6、添加考试记录
|
|
|
sqlStr = "insert into exam_record(create_at, update_at, user_id, exam_id,status) values (?,?,?,?,?)"
|