Feat: cron / Fix: users status check

This commit is contained in:
HFO4
2020-02-15 14:02:21 +08:00
parent 44d6ca487c
commit faf46745bc
22 changed files with 503 additions and 28 deletions

View File

@@ -59,3 +59,15 @@ func (user *User) GetAvailablePackSize() uint64 {
return total
}
// GetExpiredStoragePack 获取已过期的容量包
func GetExpiredStoragePack() []StoragePack {
var packs []StoragePack
DB.Where("expired_time < ?", time.Now()).Find(&packs)
return packs
}
// Delete 删除容量包
func (pack *StoragePack) Delete() error {
return DB.Delete(&pack).Error
}