Update bundleExtend.go

This commit is contained in:
JNG 2026-02-02 17:54:24 +08:00
parent 0c8631e775
commit 48e5d51373

View File

@ -158,8 +158,9 @@ func GetBundleBalanceByUserId(req *bundle.GetBundleBalanceByUserIdReq) (data mod
Joins(`INNER JOIN ( Joins(`INNER JOIN (
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
WHERE status = 2 AND deleted_at is NULL
GROUP BY customer_id GROUP BY customer_id
) bor2 ON bor1.customer_id = bor2.customer_id AND bor1.created_at = bor2.max_created_time`).Where("bor1.status = 2") ) bor2 ON bor1.customer_id = bor2.customer_id AND bor1.created_at = bor2.max_created_time`)
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,