🎨 优化定时任务,优化定时发布文章功能
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
package task
|
||||
|
||||
import (
|
||||
"git.echol.cn/loser/lckt/global"
|
||||
"git.echol.cn/loser/lckt/model/user"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// CheckVip 检查用户VIP是否过期
|
||||
func CheckVip(db *gorm.DB) error {
|
||||
global.GVA_LOG.Info("开始检查用户VIP是否过期...")
|
||||
var users []user.User
|
||||
// 根据当前时间和vip_expire_time对比 查看是否到过期时间
|
||||
db.Where("vip_expire_time < ? AND vip_expire_time IS NOT NULL", gorm.Expr("NOW()")).Find(&users)
|
||||
|
||||
Reference in New Issue
Block a user