feat: 修改统计逻辑以计算总金额

This commit is contained in:
mkm 2024-06-22 09:47:11 +08:00
parent f2c9bbdb7b
commit e25fe49941

View File

@ -512,7 +512,7 @@ class TradeStatisticLogic extends BaseLogic
})->sum($orderSumField); })->sum($orderSumField);
break; break;
case "group": case "group":
$totalMoney = $storeOrder->getCurveData($whereOrder, $where, 'count(pay_price)'); $totalMoney = $storeOrder->getCurveData($whereOrder, $where, 'sum(pay_price)');
break; break;
default: default:
throw new \Exception('getOrderRefundTotalMoney:selectType参数错误'); throw new \Exception('getOrderRefundTotalMoney:selectType参数错误');
@ -546,7 +546,7 @@ class TradeStatisticLogic extends BaseLogic
})->sum($orderSumField); })->sum($orderSumField);
break; break;
case "group": case "group":
$totalMoney = $UserSign->getCurveData($whereUserSign, $where, 'count(number)'); $totalMoney = $UserSign->getCurveData($whereUserSign, $where, 'sum(number)');
break; break;
default: default:
throw new \Exception('getUserSign:selectType参数错误'); throw new \Exception('getUserSign:selectType参数错误');
@ -579,7 +579,7 @@ class TradeStatisticLogic extends BaseLogic
})->sum('number'); })->sum('number');
break; break;
case "group": case "group":
$totalMoney = $store_finance_flow->getCurveData($where, $time, 'count(number)'); $totalMoney = $store_finance_flow->getCurveData($where, $time, 'sum(number)');
break; break;
default: default:
throw new \Exception('getFinanceFlow:selectType参数错误'); throw new \Exception('getFinanceFlow:selectType参数错误');
@ -615,7 +615,7 @@ class TradeStatisticLogic extends BaseLogic
})->sum('pay_price'); })->sum('pay_price');
break; break;
case "group": case "group":
$totalMoney = $storeOrder->getCurveData($where, $time, 'count(pay_price)', $group); $totalMoney = $storeOrder->getCurveData($where, $time, 'sum(pay_price)', $group);
break; break;
default: default:
throw new \Exception('getOrderTotalMoney:selectType参数错误'); throw new \Exception('getOrderTotalMoney:selectType参数错误');
@ -654,7 +654,7 @@ class TradeStatisticLogic extends BaseLogic
->sum($rechargeSumField); ->sum($rechargeSumField);
break; break;
case "group": case "group":
$totalMoney = $userRechage->getCurveData(['paid' => 1], $where, 'count(price)', $group); $totalMoney = $userRechage->getCurveData(['paid' => 1], $where, 'sum(price)', $group);
break; break;
default: default:
$totalMoney = 0.00; $totalMoney = 0.00;
@ -749,7 +749,7 @@ class TradeStatisticLogic extends BaseLogic
})->sum($offlineSumField); })->sum($offlineSumField);
break; break;
case "group": case "group":
$totalMoney = $storeOrder->getCurveData(['pay_type' => 17], $where, 'count(pay_price)', $group); $totalMoney = $storeOrder->getCurveData(['pay_type' => 17], $where, 'sum(pay_price)', $group);
break; break;
default: default:
throw new \Exception('getOfflineTotalMoney:selectType参数错误'); throw new \Exception('getOfflineTotalMoney:selectType参数错误');