Explorar o código

fix add user select bug

animeic %!s(int64=2) %!d(string=hai) anos
pai
achega
c1753387e9
Modificáronse 2 ficheiros con 4 adicións e 0 borrados
  1. BIN=BIN
      cmd/__debug_bin
  2. 4 0
      dao/dao-user.go

BIN=BIN
cmd/__debug_bin


+ 4 - 0
dao/dao-user.go

@@ -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 (?,?,?,?,?)"