Compare commits
No commits in common. "38fccfa82724617c2d2a8c73f467c326ffdc3397" and "e46e5a3635e26d60f21ec99371249f49e2f95cb6" have entirely different histories.
38fccfa827
...
e46e5a3635
@ -273,22 +273,15 @@ 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.
|
err = app.ModuleClients.BundleDB.Model(&model.CastWorkLog{}).Where(&model.CastWorkLog{
|
||||||
Table("cast_work_log").
|
ArtistUuid: req.ArtistUuid,
|
||||||
Select("work_uuid, MAX(update_time) AS max_update_time").
|
}).Where("confirmed_at = ?", 0).Count(&unconfirmed).Error
|
||||||
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.
|
session := app.ModuleClients.BundleDB.Model(&model.CastWorkLog{}).Where(&model.CastWorkLog{
|
||||||
Table("cast_work_log AS cwl").
|
ArtistUuid: req.ArtistUuid,
|
||||||
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