|
|
@@ -3078,7 +3078,8 @@ class OrderController extends BaseController
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 应收统计:按支付日汇总。
|
|
|
+ * 应收统计:按记账日或发货日汇总。
|
|
|
+ * timeType=bill(默认)筛 payTime;send 筛 sendTime,且只统计已付款。
|
|
|
* originAmount=未扣隔天;nextDayAmount=跨天售后;amount=已扣隔天(净额)。
|
|
|
*/
|
|
|
public function actionAccountList()
|
|
|
@@ -3104,7 +3105,14 @@ class OrderController extends BaseController
|
|
|
if ($debt > -1) {
|
|
|
$where['debt'] = $debt;
|
|
|
}
|
|
|
- $where['payTime'] = ['between', [$currentStartTime, $currentEndTime]];
|
|
|
+ // timeType=bill(默认记账 payTime)/ send(发货 sendTime)
|
|
|
+ $timeType = isset($get['timeType']) ? strval($get['timeType']) : 'bill';
|
|
|
+ $saleTimeField = ($timeType === 'send') ? 'sendTime' : 'payTime';
|
|
|
+ $where[$saleTimeField] = ['between', [$currentStartTime, $currentEndTime]];
|
|
|
+ // sendTime 不代表成交,发货口径只统计已确认付款
|
|
|
+ if ($timeType === 'send') {
|
|
|
+ $where['payStatus'] = 1;
|
|
|
+ }
|
|
|
$orderList = OrderClass::getAllByCondition($where, null, '*');
|
|
|
$list = [];
|
|
|
$totalOriginAmount = 0;
|
|
|
@@ -3228,7 +3236,8 @@ class OrderController extends BaseController
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 客户业绩(PC):按支付日汇总开单;跨天售后按通过日扣实际金额并计入退款。
|
|
|
+ * 客户业绩(PC):按记账日或发货日汇总开单;跨天售后按通过日扣实际金额并计入退款。
|
|
|
+ * timeType=bill(默认)筛 payTime;send 筛 sendTime,且只统计已付款。
|
|
|
* 与小程序 statCustomCg 同步,搜索关键词 customYj。
|
|
|
*/
|
|
|
public function actionYj()
|
|
|
@@ -3254,7 +3263,14 @@ class OrderController extends BaseController
|
|
|
if ($debt > -1) {
|
|
|
$where['debt'] = $debt;
|
|
|
}
|
|
|
- $where['payTime'] = ['between', [$currentStartTime, $currentEndTime]];
|
|
|
+ // timeType=bill(默认记账 payTime)/ send(发货 sendTime)
|
|
|
+ $timeType = isset($get['timeType']) ? strval($get['timeType']) : 'bill';
|
|
|
+ $saleTimeField = ($timeType === 'send') ? 'sendTime' : 'payTime';
|
|
|
+ $where[$saleTimeField] = ['between', [$currentStartTime, $currentEndTime]];
|
|
|
+ // sendTime 不代表成交,发货口径只统计已确认付款
|
|
|
+ if ($timeType === 'send') {
|
|
|
+ $where['payStatus'] = 1;
|
|
|
+ }
|
|
|
$orderList = OrderClass::getAllByCondition($where, null, '*');
|
|
|
$list = [];
|
|
|
$totalActPrice = 0;
|