Updata:更新随机确认时间
This commit is contained in:
parent
55dbf93c73
commit
f12da7b70a
@ -3,6 +3,7 @@ package dao
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"micro-bundle/internal/model"
|
||||
"micro-bundle/pb/bundle"
|
||||
"micro-bundle/pkg/app"
|
||||
@ -537,13 +538,14 @@ func ConfirmWork(req *bundle.ConfirmWorkReq) error {
|
||||
}
|
||||
|
||||
func GetWaitConfirmWorkList() (data []model.CastWork, err error) {
|
||||
twentyFourHoursAgo := time.Now().Add(-24 * time.Hour).Format("2006-01-02 15:04:05")
|
||||
randomHours := rand.Intn(22) + 1 // 1-22小时
|
||||
randomTimeAgo := time.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 >= ?", twentyFourHoursAgo).
|
||||
Where("submit_time >= ?", randomTimeAgo).
|
||||
Order("submit_time asc").
|
||||
Limit(10).
|
||||
Limit(5).
|
||||
Find(&data).Error
|
||||
if err != nil {
|
||||
return
|
||||
|
||||
Loading…
Reference in New Issue
Block a user