|
|
@@ -3,6 +3,7 @@
|
|
|
namespace ghs\controllers;
|
|
|
|
|
|
use biz\stat\classes\StatCgGhsClass;
|
|
|
+use bizGhs\cg\classes\CgRefundClass;
|
|
|
use bizGhs\ghs\classes\GhsClass;
|
|
|
use bizGhs\order\classes\PurchaseOrderClass;
|
|
|
use bizGhs\order\classes\PurchaseOrderItemClass;
|
|
|
@@ -47,6 +48,8 @@ class StatCgGhsController extends BaseController
|
|
|
$totalPack = 0;
|
|
|
$totalFreight = 0;
|
|
|
$totalTkPrice = 0;
|
|
|
+ //增加项
|
|
|
+ $totalOnlyTkPrice = 0;
|
|
|
$totalNum = 0;
|
|
|
if (!empty($orderList)) {
|
|
|
foreach ($orderList as $orderInfo) {
|
|
|
@@ -83,6 +86,20 @@ class StatCgGhsController extends BaseController
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //增加项
|
|
|
+ if ($tkPrice > 0) {
|
|
|
+ $refundList = CgRefundClass::getAllByCondition(['relateOrderSn' => $orderSn], null, '*', null, true);
|
|
|
+ if (!empty($refundList)) {
|
|
|
+ foreach ($refundList as $refundInfo) {
|
|
|
+ if (isset($refundInfo->refundType) && $refundInfo->refundType == 2) {
|
|
|
+ $refundPrice = $refundInfo->refundPrice ?? 0;
|
|
|
+ $totalOnlyTkPrice = bcadd($totalOnlyTkPrice, $refundPrice, 2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
$totalCarton = bcadd($totalCarton, $carton, 2);
|
|
|
$totalPack = bcadd($totalPack, $pack, 2);
|
|
|
$totalFreight = bcadd($totalFreight, $freight, 2);
|
|
|
@@ -151,7 +168,9 @@ class StatCgGhsController extends BaseController
|
|
|
'totalNum' => $totalNum,
|
|
|
'totalPack' => $totalPack,
|
|
|
'totalFreight' => $totalFreight,
|
|
|
- 'totalTkPrice' => $totalTkPrice
|
|
|
+ 'totalTkPrice' => $totalTkPrice,
|
|
|
+ //增加项
|
|
|
+ 'totalOnlyTkPrice' => $totalOnlyTkPrice,
|
|
|
]);
|
|
|
//[['amount','ghsId','ghsName','num','py']]
|
|
|
}
|