diff --git a/models/result.go b/models/result.go index f5d43816..7b7178d8 100644 --- a/models/result.go +++ b/models/result.go @@ -74,7 +74,7 @@ func (r *Result) GenerateId() { for { io.ReadFull(rand.Reader, k) r.RId = fmt.Sprintf("%x", k) - err := db.Table("results").Where("id=?", r.RId).First(&Result{}).Error + err := db.Table("results").Where("r_id=?", r.RId).First(&Result{}).Error if err == gorm.ErrRecordNotFound { break }