Merge branch 'dev-lzh' into dev
This commit is contained in:
commit
38fccfa827
@ -273,15 +273,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) {
|
||||||
err = app.ModuleClients.BundleDB.Model(&model.CastWorkLog{}).Where(&model.CastWorkLog{
|
subQuery := app.ModuleClients.BundleDB.
|
||||||
ArtistUuid: req.ArtistUuid,
|
Table("cast_work_log").
|
||||||
}).Where("confirmed_at = ?", 0).Count(&unconfirmed).Error
|
Select("work_uuid, MAX(update_time) AS max_update_time").
|
||||||
|
Group("work_uuid")
|
||||||
|
|
||||||
|
err = app.ModuleClients.BundleDB.
|
||||||
|
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).
|
||||||
|
Where("artist_uuid = ?", req.ArtistUuid).Where("confirmed_at = ?", 0).Count(&unconfirmed).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
session := app.ModuleClients.BundleDB.Model(&model.CastWorkLog{}).Where(&model.CastWorkLog{
|
session := app.ModuleClients.BundleDB.
|
||||||
ArtistUuid: req.ArtistUuid,
|
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).
|
||||||
|
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