Commit 2981b80e authored by hujiebin's avatar hujiebin

Update level.go

parent 87e3a566
...@@ -316,7 +316,7 @@ func AddCpLevelPoints(model *domain.Model, cpRelation CpRelation, points mysql.N ...@@ -316,7 +316,7 @@ func AddCpLevelPoints(model *domain.Model, cpRelation CpRelation, points mysql.N
func ClearExpireCpPoints(model *domain.Model) error { func ClearExpireCpPoints(model *domain.Model) error {
var cpLevels []*CpLevel var cpLevels []*CpLevel
// 过期 + (积分 or level) 大于0 // 过期 + (积分 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) return myerr.WrapErr(err)
} }
for _, cpLevel := range cpLevels { for _, cpLevel := range cpLevels {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment