Merge branch 'jng' into dev
This commit is contained in:
commit
83a309152e
@ -158,7 +158,7 @@ func GetBundleBalanceByUserId(req *bundle.GetBundleBalanceByUserIdReq) (data mod
|
|||||||
SELECT customer_id, MAX(created_at) AS max_created_time
|
SELECT customer_id, MAX(created_at) AS max_created_time
|
||||||
FROM bundle_order_records
|
FROM bundle_order_records
|
||||||
GROUP BY customer_id
|
GROUP BY customer_id
|
||||||
) bor2 ON bor1.customer_id = bor2.customer_id AND bor1.created_at = bor2.max_created_time`)
|
) bor2 ON bor1.customer_id = bor2.customer_id AND bor1.created_at = bor2.max_created_time`).Where("bor1.status = 2")
|
||||||
session := app.ModuleClients.BundleDB.Table("`micro-account`.`user` AS u").Unscoped().
|
session := app.ModuleClients.BundleDB.Table("`micro-account`.`user` AS u").Unscoped().
|
||||||
Select(`bb.*, bor.bundle_name, bor.status,bor.amount AS payment_amount,bor.amount_type AS payment_type,bor.customer_num,
|
Select(`bb.*, bor.bundle_name, bor.status,bor.amount AS payment_amount,bor.amount_type AS payment_type,bor.customer_num,
|
||||||
bor.uuid as order_uuid, rn.name as user_name,bc.activate,bor.created_at as pay_time,
|
bor.uuid as order_uuid, rn.name as user_name,bc.activate,bor.created_at as pay_time,
|
||||||
@ -169,7 +169,6 @@ func GetBundleBalanceByUserId(req *bundle.GetBundleBalanceByUserIdReq) (data mod
|
|||||||
Joins("LEFT JOIN bundle_activate bc on bc.user_id = u.id").
|
Joins("LEFT JOIN bundle_activate bc on bc.user_id = u.id").
|
||||||
Where("rn.name IS NOT NULL").
|
Where("rn.name IS NOT NULL").
|
||||||
Where("u.deleted_at = 0").
|
Where("u.deleted_at = 0").
|
||||||
Where("bor1.status = 2"). //查询已支付
|
|
||||||
Where("u.id = ?", req.UserId).
|
Where("u.id = ?", req.UserId).
|
||||||
Where("bb.month = ?", time.Now().Format("2006-01")).
|
Where("bb.month = ?", time.Now().Format("2006-01")).
|
||||||
Order("bor.expiration_time desc")
|
Order("bor.expiration_time desc")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user