Merge branch 'feat-hjj-AutoManuallyConfirmWorkTask'
This commit is contained in:
commit
8127a14106
@ -3,6 +3,7 @@ package dao
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"math/rand"
|
||||||
"micro-bundle/internal/model"
|
"micro-bundle/internal/model"
|
||||||
"micro-bundle/pb/bundle"
|
"micro-bundle/pb/bundle"
|
||||||
"micro-bundle/pkg/app"
|
"micro-bundle/pkg/app"
|
||||||
@ -537,13 +538,14 @@ func ConfirmWork(req *bundle.ConfirmWorkReq) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetWaitConfirmWorkList() (data []model.CastWork, err 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{}).
|
err = app.ModuleClients.BundleDB.Model(&model.CastWork{}).
|
||||||
Where("deleted_at = 0").
|
Where("deleted_at = 0").
|
||||||
Where("status = ?", 4).
|
Where("status = ?", 4).
|
||||||
Where("submit_time >= ?", twentyFourHoursAgo).
|
Where("submit_time >= ?", randomTimeAgo).
|
||||||
Order("submit_time asc").
|
Order("submit_time asc").
|
||||||
Limit(10).
|
Limit(5).
|
||||||
Find(&data).Error
|
Find(&data).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user