Merge branch 'dev-lzh' into dev

This commit is contained in:
lzh 2025-06-27 17:57:24 +08:00
commit 40b3d8ddde
2 changed files with 7 additions and 4 deletions

View File

@ -272,18 +272,22 @@ func GetVedioWorkDetail(req *bundle.GetVedioWorkDetailReq) (data model.CastWorkV
} }
func ToBeComfirmedWorks(req *bundle.ToBeComfirmedWorksReq) (data []model.CastWorkLog, total int64, unconfirmed int64, err error) { func ToBeComfirmedWorks(req *bundle.ToBeComfirmedWorksReq) (data []model.CastWorkLog, total int64, unconfirmed int64, err error) {
subQuery := app.ModuleClients.BundleDB. unConfirmSubQuery := 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").Where("work_status in ?", []int{4, 5, 6, 7}) Group("work_uuid").Where("work_status = ?", 4)
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", unConfirmSubQuery).
Where("artist_uuid = ?", req.ArtistUuid).Where("confirmed_at = ?", 0).Count(&unconfirmed).Error Where("artist_uuid = ?", req.ArtistUuid).Where("confirmed_at = ?", 0).Count(&unconfirmed).Error
if err != nil { if err != nil {
return return
} }
subQuery := app.ModuleClients.BundleDB.
Table("cast_work_log").
Select("work_uuid, MAX(update_time) AS max_update_time").
Group("work_uuid").Where("work_status in ?", []int{4, 5, 6, 7})
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).

View File

@ -156,7 +156,6 @@ func UpdateReconciliationStatusBySerialNumber(req *bundle.UpdateStatusAndPayTime
res, err = dao.UpdateReconciliationStatusBySerialNumber(req) res, err = dao.UpdateReconciliationStatusBySerialNumber(req)
return return
} }
func DeleteValueAddService(req *bundle.DeleteValueAddServiceRequest) (res *bundle.CommonResponse, err error) { func DeleteValueAddService(req *bundle.DeleteValueAddServiceRequest) (res *bundle.CommonResponse, err error) {
res = new(bundle.CommonResponse) res = new(bundle.CommonResponse)
res, err = dao.DeleteValueAddService(req) res, err = dao.DeleteValueAddService(req)