Compare commits
No commits in common. "b6fbde26533d602b32901e50f7f237c058d6d869" and "f5b8c1a9f566ddfcdaf30a7b071067974405c337" have entirely different histories.
b6fbde2653
...
f5b8c1a9f5
@ -19,9 +19,9 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
|
|||||||
Select("SUM(handling_fee)").
|
Select("SUM(handling_fee)").
|
||||||
Joins("LEFT JOIN bundle_order_records bor ON bor.order_no = bundle_order_on").
|
Joins("LEFT JOIN bundle_order_records bor ON bor.order_no = bundle_order_on").
|
||||||
Where("bor.deleted_at is null and bor.pay_time != ''")
|
Where("bor.deleted_at is null and bor.pay_time != ''")
|
||||||
// if req.BundleUuid != "" {
|
if req.BundleUuid != "" {
|
||||||
// subQuery = subQuery.Where("bor.bundle_uuid = ?", req.BundleUuid)
|
subQuery = subQuery.Where("bor.bundle_uuid = ?", req.BundleUuid)
|
||||||
// }
|
}
|
||||||
query := app.ModuleClients.BundleDB.Model(&model.BundleOrderRecords{}).
|
query := app.ModuleClients.BundleDB.Model(&model.BundleOrderRecords{}).
|
||||||
Select(`
|
Select(`
|
||||||
SUM(amount) as total_bundle_payment_amount,
|
SUM(amount) as total_bundle_payment_amount,
|
||||||
@ -30,9 +30,9 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
|
|||||||
(?) as total_fee_payment_amount
|
(?) as total_fee_payment_amount
|
||||||
`, subQuery).
|
`, subQuery).
|
||||||
Where("deleted_at IS NULL and pay_time != ''")
|
Where("deleted_at IS NULL and pay_time != ''")
|
||||||
// if req.BundleUuid != "" {
|
if req.BundleUuid != "" {
|
||||||
// query = query.Where("bundle_uuid = ?", req.BundleUuid)
|
query = query.Where("bundle_uuid = ?", req.BundleUuid)
|
||||||
// }
|
}
|
||||||
err = query.First(result).Error
|
err = query.First(result).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
@ -46,9 +46,9 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
|
|||||||
Where("`reconciliation`.created_at >= ?", req.Start+" 00:00:00").
|
Where("`reconciliation`.created_at >= ?", req.Start+" 00:00:00").
|
||||||
Where("`reconciliation`.created_at <= ?", req.End+" 23:59:59").
|
Where("`reconciliation`.created_at <= ?", req.End+" 23:59:59").
|
||||||
Where("`reconciliation`.deleted_at is null and bor.pay_time != ''")
|
Where("`reconciliation`.deleted_at is null and bor.pay_time != ''")
|
||||||
// if req.BundleUuid != "" {
|
if req.BundleUuid != "" {
|
||||||
// subQuery = subQuery.Where("bor.bundle_uuid = ?", req.BundleUuid)
|
subQuery = subQuery.Where("bor.bundle_uuid = ?", req.BundleUuid)
|
||||||
// }
|
}
|
||||||
|
|
||||||
query = app.ModuleClients.BundleDB.Model(&model.BundleOrderRecords{}).
|
query = app.ModuleClients.BundleDB.Model(&model.BundleOrderRecords{}).
|
||||||
Select(`
|
Select(`
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user