From 3e5f5e65476abe9db9911ea3b678c2251035420a Mon Sep 17 00:00:00 2001 From: hujiebin Date: Fri, 16 Jun 2023 10:35:28 +0800 Subject: [PATCH] Update level.go --- domain/model/cp_m/level.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domain/model/cp_m/level.go b/domain/model/cp_m/level.go index b6b78e3..283e924 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("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 { + if err := model.DB().Table("cp_level").Joins("INNER JOIN cp_relation r ON cp_id = r.id").Where("expire_at < ? AND (points > 0 or level > 0) ", time.Now()).Find(&cpLevels).Error; err != nil { return myerr.WrapErr(err) } for _, cpLevel := range cpLevels { -- 2.22.0