Compare commits

..

No commits in common. "7154d0a92a0e56181828537613f38c87f2d9a3dc" and "cd4e1492c81c9e017ab4aa7f5858d516d372a714" have entirely different histories.

View File

@ -99,9 +99,6 @@ func GetBundleExtendRecordList(req *bundle.BundleExtendRecordsListRequest) (data
}
func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.BundleBalancePo, total int64, err error) {
subQuery := app.ModuleClients.BundleDB.Table("bundle_order_records").
Select("customer_id, MAX(created_at) AS max_created_time").
Group("customer_id")
session := app.ModuleClients.BundleDB.Table("`micro-account`.`user` AS u").
Select(`
bb.*,
@ -116,8 +113,7 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.Bun
Joins("LEFT JOIN fiee_bundle.bundle_balance AS bb on u.id = bb.user_id").
Joins("LEFT JOIN `micro-account`.`real_name` rn on u.real_name_id = rn.id").
Joins("LEFT JOIN bundle_order_records bor on bor.uuid = bb.order_uuid").
Joins("INNER JOIN (?) AS t ON bor.customer_id = t.customer_id AND bor.created_at = t.max_created_time", subQuery).
Where("rn.name IS NOT NULL and u.deleted_at = 0")
Where("bor.deleted_at IS NULL and rn.name IS NOT NULL and u.deleted_at = 0")
if req.UserName != "" {
if utils.IsPhoneNumber(req.UserName) {
session = session.Where("u.tel_num = ?", req.UserName)
@ -292,7 +288,7 @@ func ToBeComfirmedWorks(req *bundle.ToBeComfirmedWorksReq) (data []model.CastWor
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).Where("work_status in ?", []int{4, 5, 6, 7})
Where("artist_uuid = ?", req.ArtistUuid)
err = session.Count(&total).Error
if err != nil {
return