Updata:更新获取数据条件
This commit is contained in:
parent
f12da7b70a
commit
97ac650055
@ -538,12 +538,15 @@ func ConfirmWork(req *bundle.ConfirmWorkReq) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetWaitConfirmWorkList() (data []model.CastWork, err error) {
|
func GetWaitConfirmWorkList() (data []model.CastWork, err error) {
|
||||||
randomHours := rand.Intn(22) + 1 // 1-22小时
|
randomHours := rand.Intn(22) + 2 // 2-22小时
|
||||||
randomTimeAgo := time.Now().Add(-time.Duration(randomHours) * time.Hour).Format("2006-01-02 15:04:05")
|
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{}).
|
err = app.ModuleClients.BundleDB.Model(&model.CastWork{}).
|
||||||
Where("deleted_at = 0").
|
Where("deleted_at = 0").
|
||||||
Where("status = ?", 4).
|
Where("status = ?", 4).
|
||||||
Where("submit_time >= ?", randomTimeAgo).
|
Where("submit_time > ?", startTime).
|
||||||
|
Where("submit_time < ?", endTime).
|
||||||
Order("submit_time asc").
|
Order("submit_time asc").
|
||||||
Limit(5).
|
Limit(5).
|
||||||
Find(&data).Error
|
Find(&data).Error
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user