shish 1 год назад
Родитель
Сommit
93c42e0bad
1 измененных файлов с 9 добавлено и 9 удалено
  1. 9 9
      biz-ghs/stat/classes/StatSaleClass.php

+ 9 - 9
biz-ghs/stat/classes/StatSaleClass.php

@@ -1311,21 +1311,21 @@ class StatSaleClass extends BaseClass
                 if ($actPrice <= 0) {
                     continue;
                 }
-                $sendStaffId = $ghsOrder['sendStaffId']??0;
-                $sendStaffName = $ghsOrder['sendStaffName']??'未记名';
-                if(isset($arr[$sendStaffId])){
-                    $arr[$sendStaffId]['orderNum'] = bcadd($arr[$sendStaffId]['orderNum'],1);
-                    $arr[$sendStaffId]['amount'] = bcadd($arr[$sendStaffId]['amount'],$actPrice,2);
-                }else{
-                    $arr[$sendStaffId] = ['staffName'=>$sendStaffName,'orderNum'=>1,'itemNum'=>0,'amount'=>$actPrice];
+                $sendStaffId = $ghsOrder['sendStaffId'] ?? 0;
+                $sendStaffName = $ghsOrder['sendStaffName'] ?? '未记名';
+                if (isset($arr[$sendStaffId])) {
+                    $arr[$sendStaffId]['orderNum'] = bcadd($arr[$sendStaffId]['orderNum'], 1);
+                    $arr[$sendStaffId]['amount'] = bcadd($arr[$sendStaffId]['amount'], $actPrice, 2);
+                } else {
+                    $arr[$sendStaffId] = ['staffName' => $sendStaffName, 'orderNum' => 1, 'itemNum' => 0, 'amount' => $actPrice, 'staffId' => $sendStaffId];
                 }
                 $orderItemList = OrderItemClass::getAllByCondition(['orderSn' => $orderSn], null, '*', null, true);
                 if (!empty($orderItemList)) {
                     foreach ($orderItemList as $orderItem) {
                         $refundNum = $orderItem->refundNum ?? 0;
                         $num = $orderItem->xhNum ?? 0;
-                        $remainNum = bcsub($num,$refundNum);
-                        $arr[$sendStaffId]['itemNum'] = bcadd($arr[$sendStaffId]['itemNum'],$remainNum);
+                        $remainNum = bcsub($num, $refundNum);
+                        $arr[$sendStaffId]['itemNum'] = bcadd($arr[$sendStaffId]['itemNum'], $remainNum);
                     }
                 }
             }