From e4b785e18693387b6fc6b6cc4ad485fa7c02d01f Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 2 Aug 2024 15:52:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E4=BA=86=E5=95=86?= =?UTF-8?q?=E5=93=81=E6=94=AF=E4=BB=98=E9=87=91=E9=A2=9D=E3=80=81=E7=A4=BC?= =?UTF-8?q?=E5=93=81=E5=88=B8=E6=B6=88=E8=80=97=E3=80=81=E5=85=85=E5=80=BC?= =?UTF-8?q?=E9=87=91=E9=A2=9D=E7=AD=89=E4=BA=A4=E6=98=93=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E5=B9=B6=E6=9B=B4=E6=96=B0=E4=BA=86?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=8F=8F=E8=BF=B0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logic/statistic/TradeStatisticLogic.php | 50 +++++++++++-------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/app/admin/logic/statistic/TradeStatisticLogic.php b/app/admin/logic/statistic/TradeStatisticLogic.php index 7297e10c7..e9fc6a7b0 100644 --- a/app/admin/logic/statistic/TradeStatisticLogic.php +++ b/app/admin/logic/statistic/TradeStatisticLogic.php @@ -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);