From f12da7b70a1bfc54ce34bacc90a2b2a399b8c36d Mon Sep 17 00:00:00 2001 From: "jiaji.H" Date: Thu, 18 Dec 2025 14:28:30 +0800 Subject: [PATCH] =?UTF-8?q?Updata=EF=BC=9A=E6=9B=B4=E6=96=B0=E9=9A=8F?= =?UTF-8?q?=E6=9C=BA=E7=A1=AE=E8=AE=A4=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/dao/bundleExtend.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/internal/dao/bundleExtend.go b/internal/dao/bundleExtend.go index fb7cfe5..c9e7493 100644 --- a/internal/dao/bundleExtend.go +++ b/internal/dao/bundleExtend.go @@ -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