Updata:更新获取数据条件

This commit is contained in:
jiaji.H 2025-12-18 15:15:01 +08:00
parent f12da7b70a
commit 97ac650055

View File

@ -538,12 +538,15 @@ func ConfirmWork(req *bundle.ConfirmWorkReq) error {
}
func GetWaitConfirmWorkList() (data []model.CastWork, err error) {
randomHours := rand.Intn(22) + 1 // 1-22小时
randomTimeAgo := time.Now().Add(-time.Duration(randomHours) * time.Hour).Format("2006-01-02 15:04:05")
randomHours := rand.Intn(22) + 2 // 2-22小时
now := time.Now()
startTime := now.Add(-time.Duration(randomHours+2) * time.Hour).Format("2006-01-02 15:04:05")
endTime := now.Add(-time.Duration(randomHours) * time.Hour).Format("2006-01-02 15:04:05")
err = app.ModuleClients.BundleDB.Model(&model.CastWork{}).
Where("deleted_at = 0").
Where("status = ?", 4).
Where("submit_time >= ?", randomTimeAgo).
Where("submit_time > ?", startTime).
Where("submit_time < ?", endTime).
Order("submit_time asc").
Limit(5).
Find(&data).Error