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) {
|
||||
err = app.ModuleClients.BundleDB.Model(&model.CastWorkLog{}).Where(&model.CastWorkLog{
|
||||
ArtistUuid: req.ArtistUuid,
|
||||
}).Where("confirmed_at = ?", 0).Count(&unconfirmed).Error
|
||||
subQuery := app.ModuleClients.BundleDB.
|
||||
Table("cast_work_log").
|
||||
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 {
|
||||
return
|
||||
}
|
||||
session := app.ModuleClients.BundleDB.Model(&model.CastWorkLog{}).Where(&model.CastWorkLog{
|
||||
ArtistUuid: req.ArtistUuid,
|
||||
})
|
||||
session := 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)
|
||||
err = session.Count(&total).Error
|
||||
if err != nil {
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user