`
This commit is contained in:
parent
4f9b72928b
commit
0a4218757e
@ -10,6 +10,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"dubbo.apache.org/dubbo-go/v3/common/logger"
|
||||||
"github.com/duke-git/lancet/v2/datetime"
|
"github.com/duke-git/lancet/v2/datetime"
|
||||||
|
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
@ -32,6 +33,7 @@ func AddBundleExtendRecord(data model.BundleExtensionRecords) error {
|
|||||||
expireTime = et
|
expireTime = et
|
||||||
} else {
|
} else {
|
||||||
expireTime = time.Now()
|
expireTime = time.Now()
|
||||||
|
logger.Infof("过期时间为空,使用默认过期时间" + expireTime.Format(time.DateTime))
|
||||||
}
|
}
|
||||||
|
|
||||||
switch data.TimeUnit {
|
switch data.TimeUnit {
|
||||||
@ -272,19 +274,19 @@ func ToBeComfirmedWorks(req *bundle.ToBeComfirmedWorksReq) (data []model.CastWor
|
|||||||
subQuery := app.ModuleClients.BundleDB.
|
subQuery := app.ModuleClients.BundleDB.
|
||||||
Table("cast_work_log").
|
Table("cast_work_log").
|
||||||
Select("work_uuid, MAX(update_time) AS max_update_time").
|
Select("work_uuid, MAX(update_time) AS max_update_time").
|
||||||
Group("work_uuid")
|
Group("work_uuid").Where("work_status in ?", []int{4, 5, 6, 7})
|
||||||
|
|
||||||
err = app.ModuleClients.BundleDB.
|
err = app.ModuleClients.BundleDB.
|
||||||
Table("cast_work_log AS cwl").
|
Table("cast_work_log AS cwl").
|
||||||
Joins("INNER JOIN (?) AS t ON cwl.work_uuid = t.work_uuid AND cwl.update_time = t.max_update_time", subQuery).
|
Joins("INNER JOIN (?) AS t ON cwl.work_uuid = t.work_uuid AND cwl.update_time = t.max_update_time", subQuery).
|
||||||
Where("artist_uuid = ?", req.ArtistUuid).Where("confirmed_at = ?", 0).Where("work_status in ?", []int{4, 5, 6, 7}).Count(&unconfirmed).Error
|
Where("artist_uuid = ?", req.ArtistUuid).Where("confirmed_at = ?", 0).Count(&unconfirmed).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
session := app.ModuleClients.BundleDB.
|
session := app.ModuleClients.BundleDB.
|
||||||
Table("cast_work_log AS cwl").
|
Table("cast_work_log AS cwl").
|
||||||
Joins("INNER JOIN (?) AS t ON cwl.work_uuid = t.work_uuid AND cwl.update_time = t.max_update_time", subQuery).
|
Joins("INNER JOIN (?) AS t ON cwl.work_uuid = t.work_uuid AND cwl.update_time = t.max_update_time", subQuery).
|
||||||
Where("artist_uuid = ?", req.ArtistUuid).Where("work_status in ?", []int{4, 5, 6, 7})
|
Where("artist_uuid = ?", req.ArtistUuid)
|
||||||
err = session.Count(&total).Error
|
err = session.Count(&total).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user