@@ -139,6 +139,10 @@ func InsertUser(user *entity.User, userType string) *result.Result {
if err != nil && err != sql.ErrNoRows {
return result.UNKNOW_ERROR.SetMsg(err.Error())
}
+ // count == examId []
+ if len(count) == 0 {
+ return result.SUCCESS.SetData(id)
+ }
// 6、添加考试记录
sqlStr = "insert into exam_record(create_at, update_at, user_id, exam_id,status) values (?,?,?,?,?)"