shish 1 年之前
父節點
當前提交
dbef8f0312
共有 1 個文件被更改,包括 22 次插入22 次删除
  1. 22 22
      app-ghs/controllers/OrderController.php

+ 22 - 22
app-ghs/controllers/OrderController.php

@@ -2306,32 +2306,32 @@ class OrderController extends BaseController
                 if ($book == 1 && $status == 2) {
                 if ($book == 1 && $status == 2) {
                     continue;
                     continue;
                 }
                 }
-                if ($actPrice <= 0) {
-                    //全部已经售后
-                    continue;
-                }
+
                 $carton = 0;
                 $carton = 0;
                 $pack = 0;
                 $pack = 0;
                 $freight = 0;
                 $freight = 0;
                 $orderItemList = OrderItemClass::getAllByCondition(['orderSn' => $orderSn], null, '*');
                 $orderItemList = OrderItemClass::getAllByCondition(['orderSn' => $orderSn], null, '*');
-                if (!empty($orderItemList)) {
-                    foreach ($orderItemList as $orderItem) {
-                        $num = $orderItem['xhNum'] ?? 0;
-                        $unitPrice = $orderItem['xhUnitPrice'] ?? 0;
-                        $refundNum = $orderItem['refundNum'] ?? 0;
-                        $classId = $orderItem['classId'] ?? 0;
-                        if (getenv('YII_ENV') == 'production') {
-                            if ($mainId == 23390) {
-                                $remainNum = bcsub($num, $refundNum);
-                                $amount = bcmul($remainNum, $unitPrice, 2);
-                                if ($classId == 72106) {
-                                    $carton = bcadd($carton, $amount, 2);
-                                }
-                                if ($classId == 72108) {
-                                    $pack = bcadd($pack, $amount, 2);
-                                }
-                                if ($classId == 73118) {
-                                    $freight = bcadd($freight, $amount, 2);
+                if ($actPrice > 0) {
+                    if (!empty($orderItemList)) {
+                        foreach ($orderItemList as $orderItem) {
+                            $num = $orderItem['xhNum'] ?? 0;
+                            $unitPrice = $orderItem['xhUnitPrice'] ?? 0;
+                            $refundNum = $orderItem['refundNum'] ?? 0;
+                            $classId = $orderItem['classId'] ?? 0;
+                            if (getenv('YII_ENV') == 'production') {
+                                //小向算打包纸箱费用
+                                if ($mainId == 23390) {
+                                    $remainNum = bcsub($num, $refundNum);
+                                    $amount = bcmul($remainNum, $unitPrice, 2);
+                                    if ($classId == 72106) {
+                                        $carton = bcadd($carton, $amount, 2);
+                                    }
+                                    if ($classId == 72108) {
+                                        $pack = bcadd($pack, $amount, 2);
+                                    }
+                                    if ($classId == 73118) {
+                                        $freight = bcadd($freight, $amount, 2);
+                                    }
                                 }
                                 }
                             }
                             }
                         }
                         }