From a3e8ea394a024247ff2813b6ca8bf3ed67633ecc Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 21 Jun 2024 11:50:49 +0800 Subject: [PATCH] =?UTF-8?q?feat(statistic):=20=E6=B7=BB=E5=8A=A0=E4=BF=9D?= =?UTF-8?q?=E8=AF=81=E9=87=91=E9=87=91=E9=A2=9D=E5=92=8C=E5=95=86=E5=93=81?= =?UTF-8?q?=E9=80=80=E6=AC=BE=E9=87=91=E9=A2=9D=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logic/statistic/TradeStatisticLogic.php | 98 +++++++++---------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/app/admin/logic/statistic/TradeStatisticLogic.php b/app/admin/logic/statistic/TradeStatisticLogic.php index 90408c87..d2504b60 100644 --- a/app/admin/logic/statistic/TradeStatisticLogic.php +++ b/app/admin/logic/statistic/TradeStatisticLogic.php @@ -310,6 +310,40 @@ class TradeStatisticLogic extends BaseLogic ]; $Chain['out_ye'] = $outYeCurve; + //保证金金额 + $depositWehre = $where; + $depositWehre['financial_type'] = 11; + $orderDepositMoney = $this->getFinanceFlow($depositWehre, "sum"); + $lastOrderDepositMoney = $this->getFinanceFlow($dateWhere, "sum", "", $isNum); + $OrderDepositCurve = $this->getFinanceFlow($where, "group", "create_time"); + $OrderDepositChain = countRate($orderDepositMoney, $lastOrderDepositMoney); + + $topData[8] = [ + 'title' => '保证金金额', + 'desc' => '门店未交满,订单扣除的保证金', + 'total_money' => $orderDepositMoney, + 'rate' => $OrderDepositChain, + 'value' => $OrderDepositCurve['y'], + 'type' => 1, + 'sign' => 'deposit', + ]; + $Chain['deposit'] = $OrderDepositCurve; + //兑换礼品券 + $userSign = $this->getUserSign($where, 'sum'); + $userSignTwo = $this->getUserSign($where, 'sum', "", $isNum); + $userSignGroup = $this->getUserSign($where, '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'); $rechgeMoneyAdmin = $this->getBillYeTotalMoney($where, 'sum'); @@ -321,7 +355,7 @@ class TradeStatisticLogic extends BaseLogic $RechgeAdminCurve = $this->getBillYeTotalMoney($where, 'group', "create_time"); $RechgeTotalCurve = $this->totalArrData([$RechgeHomeCurve, $RechgeAdminCurve]); $RechgeChain = countRate($rechgeMoneyTotal, $lastRechgeMoneyTotal); - $topData[12] = [ + $topData[10] = [ 'title' => '充值金额', 'desc' => '选定条件下,用户成功充值的金额', 'total_money' => $rechgeMoneyTotal, @@ -332,22 +366,6 @@ class TradeStatisticLogic extends BaseLogic ]; $Chain['rechage'] = $RechgeTotalCurve; - //商品退款金额 - $outOrderRefund = $this->getOrderRefundTotalMoney(['create_time' => $where['create_time']], 'sum'); - $lastOutOrderRefund = $this->getOrderRefundTotalMoney(['create_time' => $dateWhere['create_time']], 'sum', "", $isNum); - $outOrderRefundCurve = $this->getOrderRefundTotalMoney(['create_time' => $where['create_time']], 'group', 'create_time'); - $orderRefundChain = countRate($outOrderRefund, $lastOutOrderRefund); - $topData[9] = [ - 'title' => '商品退款金额', - 'desc' => '用户成功退款的商品金额', - 'total_money' => $outOrderRefund, - 'rate' => $orderRefundChain, - 'value' => $outOrderRefundCurve['y'], - 'type' => 0, - 'sign' => 'refund', - ]; - $Chain['refund'] = $outOrderRefundCurve; - //支出金额 // $outTotalMoney = bcadd($outYeMoney, $outExtractMoney, 2); // $lastOutTotalMoney = bcadd($lastOutYeMoney, $lastOutExtractMoney, 2); @@ -367,40 +385,22 @@ class TradeStatisticLogic extends BaseLogic ]; $Chain['out'] = $outTotalCurve; - //兑换礼品券 - $userSign = $this->getUserSign($where, 'sum'); - $userSignTwo = $this->getUserSign($where, 'sum', "", $isNum); - $userSignGroup = $this->getUserSign($where, 'group', "create_time"); - $userSignRate = countRate($userSign, $userSignTwo); - $topData[8] = [ - 'title' => '兑换礼品券', - 'desc' => '后台给推广员支付的兑换礼品券,以实际支付为准', - 'total_money' => $userSign, - 'rate' => $userSignRate, - 'value' => $userSignGroup['y'], - 'type' => 1, - 'sign' => 'user_sign', + //商品退款金额 + $outOrderRefund = $this->getOrderRefundTotalMoney(['create_time' => $where['create_time']], 'sum'); + $lastOutOrderRefund = $this->getOrderRefundTotalMoney(['create_time' => $dateWhere['create_time']], 'sum', "", $isNum); + $outOrderRefundCurve = $this->getOrderRefundTotalMoney(['create_time' => $where['create_time']], 'group', 'create_time'); + $orderRefundChain = countRate($outOrderRefund, $lastOutOrderRefund); + $topData[12] = [ + 'title' => '商品退款金额', + 'desc' => '用户成功退款的商品金额', + 'total_money' => $outOrderRefund, + 'rate' => $orderRefundChain, + 'value' => $outOrderRefundCurve['y'], + 'type' => 0, + 'sign' => 'refund', ]; - $Chain['user_sign'] = $userSignGroup; + $Chain['refund'] = $outOrderRefundCurve; - //保证金金额 - $depositWehre = $where; - $depositWehre['financial_type'] = 11; - $orderDepositMoney = $this->getFinanceFlow($depositWehre, "sum"); - $lastOrderDepositMoney = $this->getFinanceFlow($dateWhere, "sum", "", $isNum); - $OrderDepositCurve = $this->getFinanceFlow($where, "group", "create_time"); - $OrderDepositChain = countRate($orderDepositMoney, $lastOrderDepositMoney); - - $topData[10] = [ - 'title' => '保证金金额', - 'desc' => '门店未交满,订单扣除的保证金', - 'total_money' => $orderDepositMoney, - 'rate' => $OrderDepositChain, - 'value' => $OrderDepositCurve['y'], - 'type' => 1, - 'sign' => 'deposit', - ]; - $Chain['deposit'] = $OrderDepositCurve; /** @var 营业额 $inTotalMoney */