diff --git a/internal/dao/bundleMetrics.go b/internal/dao/bundleMetrics.go index a8af20c..ef80e44 100644 --- a/internal/dao/bundleMetrics.go +++ b/internal/dao/bundleMetrics.go @@ -20,7 +20,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi // ---------- 总金额统计 ---------- subQuery := app.ModuleClients.BundleDB.Model(&model.Reconciliation{}). Select("TRUNCATE(COALESCE(SUM(CAST(handling_fee AS DECIMAL(12,3))), 0), 3) as total_fee_payment_amount"). - 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 COLLATE utf8mb4_general_ci = reconciliation.bundle_order_on COLLATE utf8mb4_general_ci"). Where("bor.deleted_at is null and bor.status=2") // if req.BundleUuid != "" { // subQuery = subQuery.Where("bor.bundle_uuid = ?", req.BundleUuid) @@ -72,7 +72,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi subQuery = app.ModuleClients.BundleDB.Model(&model.Reconciliation{}). Select("SUM(handling_fee) as new_fee_payment_amount, SUM(pay_amount) as new_payment_amount"). - 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 COLLATE utf8mb4_general_ci = bundle_order_on COLLATE utf8mb4_general_ci"). Where("`reconciliation`.pay_time >= ?", req.Start+" 00:00:00"). Where("`reconciliation`.pay_time <= ?", req.End+" 23:59:59"). Where("`reconciliation`.deleted_at is null and reconciliation.pay_status = 2 and bor.status=2 and bor.deleted_at is null")