feat: 修改了商品支付金额、礼品券消耗、充值金额等交易统计逻辑,并更新了相关描述。

This commit is contained in:
mkm 2024-08-02 15:52:12 +08:00
parent 54b2add707
commit e4b785e186

View File

@ -214,7 +214,7 @@ class TradeStatisticLogic extends BaseLogic
$OrderChain = countRate($OrderMoney, $lastOrderMoney);
$topData[2] = [
'title' => '商品支付金额',
'desc' => '选定条件下,用户购买商品的实际支付金额,包括微信支付、余额支付、支付宝支付、线下支付金额(拼团商品在成团之后计入,线下支付订单在后台确认支付后计入)',
'desc' => '选定条件下,用户购买商品的实际支付金额,包括微信支付、余额支付、支付宝支付、线下支付金额',
'total_money' => $OrderMoney,
'rate' => $OrderChain,
'value' => $OrderCurve['y'],
@ -328,20 +328,21 @@ class TradeStatisticLogic extends BaseLogic
];
$Chain['deposit'] = $OrderDepositCurve;
//兑换礼品券
$userSign = $this->getOrderTotalMoney(['pay_type' => 19, 'create_time' => $where['create_time']], 'sum');
$userSignTwo = $this->getOrderTotalMoney(['pay_type' => 19, 'create_time' => $dateWhere['create_time']], 'sum', "", $isNum);
$userSignGroup = $this->getOrderTotalMoney(['pay_type' => 19, 'create_time' => $where['create_time']], 'group', 'create_time');
$userSignRate = countRate($userSign, $userSignTwo);
$topData[9] = [
'title' => '礼品券消耗',
'desc' => '用户下单时使用礼品券实际支付的金额',
'total_money' => $userSign,
'rate' => $userSignRate,
'value' => $userSignGroup['y'],
'type' => 1,
'sign' => 'user_sign',
];
$Chain['user_sign'] = $userSignGroup;
// $userSign = $this->getOrderTotalMoney(['pay_type' => 19, 'create_time' => $where['create_time']], 'sum');
// $userSignTwo = $this->getOrderTotalMoney(['pay_type' => 19, 'create_time' => $dateWhere['create_time']], 'sum', "", $isNum);
// $userSignGroup = $this->getOrderTotalMoney(['pay_type' => 19, 'create_time' => $where['create_time']], 'group', 'create_time');
// $userSignRate = countRate($userSign, $userSignTwo);
// $topData[9] = [
// 'title' => '礼品券消耗',
// 'desc' => '用户下单时使用礼品券实际支付的金额',
// 'total_money' => $userSign,
// 'rate' => $userSignRate,
// 'value' => $userSignGroup['y'],
// 'type' => 1,
// 'sign' => 'user_sign',
// ];
// $Chain['user_sign'] = $userSignGroup;
/** 充值金额 */
$rechgeMoneyHome = $this->getRechargeTotalMoney($where, 'sum');
@ -355,8 +356,8 @@ class TradeStatisticLogic extends BaseLogic
$RechgeTotalCurve = $this->totalArrData([$RechgeHomeCurve, $RechgeAdminCurve]);
$RechgeChain = countRate($rechgeMoneyTotal, $lastRechgeMoneyTotal);
$topData[10] = [
'title' => '充值金额',
'desc' => '选定条件下,用户成功充值的金额',
'title' => '消费金金额',
'desc' => '选定条件下,用户购买的消费金',
'total_money' => $rechgeMoneyTotal,
'rate' => $RechgeChain,
'value' => $RechgeTotalCurve['y'],
@ -365,6 +366,15 @@ class TradeStatisticLogic extends BaseLogic
];
$Chain['rechage'] = $RechgeTotalCurve;
$topData[9] = [
'title' => '微信渠道金额',
'desc' => '用户使用微信下单和购买消费金的金额',
'total_money' => bcadd($wechatOrderMoney,$rechgeMoneyTotal,2),
'rate' => 0,
'value' => [],
'type' => 1,
'sign' => 'wechat_all',
];
//支出金额
// $outTotalMoney = bcadd($outYeMoney, $outExtractMoney, 2);
// $lastOutTotalMoney = bcadd($lastOutYeMoney, $lastOutExtractMoney, 2);
@ -409,7 +419,7 @@ class TradeStatisticLogic extends BaseLogic
$inTotalChain = countRate($inTotalMoney, $lastInTotalMoney);
$topData[0] = [
'title' => '营业额',
'desc' => '商品支付金额、充值金额、购买付费会员金额、线下收银金额',
'desc' => '商品支付金额、采购支付、线下收银金额',
'total_money' => $inTotalMoney,
'rate' => $inTotalChain,
'value' => $inTotalCurve['y'],
@ -445,10 +455,10 @@ class TradeStatisticLogic extends BaseLogic
$inOrderMoney = $this->getOrderTotalMoney($where, $selectType, "", $isNum);
//用户充值收入
$inRechargeMoneyHome = $this->getRechargeTotalMoney($where, $selectType, "", $isNum);
// $inRechargeMoneyHome = $this->getRechargeTotalMoney($where, $selectType, "", $isNum);
$inrechgeMoneyAdmin = $this->getBillYeTotalMoney($where, $selectType, '', $isNum);
$inRechargeMoney = bcadd($inRechargeMoneyHome, $inrechgeMoneyAdmin, 2);
$inRechargeMoney = bcadd(0, $inrechgeMoneyAdmin, 2);
//购买会员收入
$inMemberMoney = $this->getMemberTotalMoney($where, $selectType, "", $isNum);