feat(statistic): 添加保证金金额和商品退款金额统计
This commit is contained in:
parent
7dc73909ba
commit
a3e8ea394a
@ -310,6 +310,40 @@ class TradeStatisticLogic extends BaseLogic
|
|||||||
];
|
];
|
||||||
$Chain['out_ye'] = $outYeCurve;
|
$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');
|
$rechgeMoneyHome = $this->getRechargeTotalMoney($where, 'sum');
|
||||||
$rechgeMoneyAdmin = $this->getBillYeTotalMoney($where, 'sum');
|
$rechgeMoneyAdmin = $this->getBillYeTotalMoney($where, 'sum');
|
||||||
@ -321,7 +355,7 @@ class TradeStatisticLogic extends BaseLogic
|
|||||||
$RechgeAdminCurve = $this->getBillYeTotalMoney($where, 'group', "create_time");
|
$RechgeAdminCurve = $this->getBillYeTotalMoney($where, 'group', "create_time");
|
||||||
$RechgeTotalCurve = $this->totalArrData([$RechgeHomeCurve, $RechgeAdminCurve]);
|
$RechgeTotalCurve = $this->totalArrData([$RechgeHomeCurve, $RechgeAdminCurve]);
|
||||||
$RechgeChain = countRate($rechgeMoneyTotal, $lastRechgeMoneyTotal);
|
$RechgeChain = countRate($rechgeMoneyTotal, $lastRechgeMoneyTotal);
|
||||||
$topData[12] = [
|
$topData[10] = [
|
||||||
'title' => '充值金额',
|
'title' => '充值金额',
|
||||||
'desc' => '选定条件下,用户成功充值的金额',
|
'desc' => '选定条件下,用户成功充值的金额',
|
||||||
'total_money' => $rechgeMoneyTotal,
|
'total_money' => $rechgeMoneyTotal,
|
||||||
@ -332,22 +366,6 @@ class TradeStatisticLogic extends BaseLogic
|
|||||||
];
|
];
|
||||||
$Chain['rechage'] = $RechgeTotalCurve;
|
$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);
|
// $outTotalMoney = bcadd($outYeMoney, $outExtractMoney, 2);
|
||||||
// $lastOutTotalMoney = bcadd($lastOutYeMoney, $lastOutExtractMoney, 2);
|
// $lastOutTotalMoney = bcadd($lastOutYeMoney, $lastOutExtractMoney, 2);
|
||||||
@ -367,40 +385,22 @@ class TradeStatisticLogic extends BaseLogic
|
|||||||
];
|
];
|
||||||
$Chain['out'] = $outTotalCurve;
|
$Chain['out'] = $outTotalCurve;
|
||||||
|
|
||||||
//兑换礼品券
|
//商品退款金额
|
||||||
$userSign = $this->getUserSign($where, 'sum');
|
$outOrderRefund = $this->getOrderRefundTotalMoney(['create_time' => $where['create_time']], 'sum');
|
||||||
$userSignTwo = $this->getUserSign($where, 'sum', "", $isNum);
|
$lastOutOrderRefund = $this->getOrderRefundTotalMoney(['create_time' => $dateWhere['create_time']], 'sum', "", $isNum);
|
||||||
$userSignGroup = $this->getUserSign($where, 'group', "create_time");
|
$outOrderRefundCurve = $this->getOrderRefundTotalMoney(['create_time' => $where['create_time']], 'group', 'create_time');
|
||||||
$userSignRate = countRate($userSign, $userSignTwo);
|
$orderRefundChain = countRate($outOrderRefund, $lastOutOrderRefund);
|
||||||
$topData[8] = [
|
$topData[12] = [
|
||||||
'title' => '兑换礼品券',
|
'title' => '商品退款金额',
|
||||||
'desc' => '后台给推广员支付的兑换礼品券,以实际支付为准',
|
'desc' => '用户成功退款的商品金额',
|
||||||
'total_money' => $userSign,
|
'total_money' => $outOrderRefund,
|
||||||
'rate' => $userSignRate,
|
'rate' => $orderRefundChain,
|
||||||
'value' => $userSignGroup['y'],
|
'value' => $outOrderRefundCurve['y'],
|
||||||
'type' => 1,
|
'type' => 0,
|
||||||
'sign' => 'user_sign',
|
'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 */
|
/** @var 营业额 $inTotalMoney */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user