diff --git a/domain/model/cp_m/level.go b/domain/model/cp_m/level.go index 22bbe1ed98f9a800d2a0a8ec9c6c12ff99b7e28f..b6b78e364dd2a831ea228185df498ea4a5783c9d 100644 --- a/domain/model/cp_m/level.go +++ b/domain/model/cp_m/level.go @@ -316,7 +316,7 @@ func AddCpLevelPoints(model *domain.Model, cpRelation CpRelation, points mysql.N func ClearExpireCpPoints(model *domain.Model) error { var cpLevels []*CpLevel // 过期 + (积分 or level) 大于0 - if err := model.DB().Table("cp_level l").Joins("cp_relation r ON l.cp_id = r.id").Where("l.expire_at < ? AND (l.points > 0 or l.level > 0) ", time.Now()).Find(&cpLevels).Error; err != nil { + if err := model.DB().Table("cp_level l").Joins("INNER JOIN cp_relation r ON l.cp_id = r.id").Where("l.expire_at < ? AND (l.points > 0 or l.level > 0) ", time.Now()).Find(&cpLevels).Error; err != nil { return myerr.WrapErr(err) } for _, cpLevel := range cpLevels {