fix(store): 修复工作台订单金额统计问题

- 修改了退款金额统计的查询条件,去除了 refund_status 筛选
- 添加了保留两位小数的精度设置
This commit is contained in:
mkm 2024-11-08 00:53:43 +08:00
parent b10abde619
commit 573ff9dc9d

View File

@ -71,8 +71,10 @@ class WorkbenchLogic extends BaseLogic
$orderLogic = new StoreOrderLogic(); $orderLogic = new StoreOrderLogic();
//订单总金额 //订单总金额
$pay_price=$orderLogic->storeOrderSumByDate($startTime, $endTime, $where); $pay_price=$orderLogic->storeOrderSumByDate($startTime, $endTime, $where);
$refund_price=$orderLogic->storeOrderSumByDate($startTime, $endTime, $where,'refund_price'); unset($where['refund_status']);
$data['order_amount'] = bcsub($pay_price,$refund_price); $wheres=$where;
$refund_price=$orderLogic->storeOrderSumByDate($startTime, $endTime, $wheres,'refund_price');
$data['order_amount'] = bcsub($pay_price,$refund_price,2);
//余额支付总金额 //余额支付总金额
$data['balance_amount'] = $orderLogic->storeOrderSumByDate($startTime, $endTime, array_merge($where, ['pay_type' => PayEnum::BALANCE_PAY])); $data['balance_amount'] = $orderLogic->storeOrderSumByDate($startTime, $endTime, array_merge($where, ['pay_type' => PayEnum::BALANCE_PAY]));
//微信条码支付总金额 //微信条码支付总金额