shish hace 5 años
padre
commit
f9f172a29d
Se han modificado 1 ficheros con 20 adiciones y 7 borrados
  1. 20 7
      biz-ghs/order/classes/OrderClass.php

+ 20 - 7
biz-ghs/order/classes/OrderClass.php

@@ -439,7 +439,7 @@ class OrderClass extends BaseClass
         }
         }
 
 
         $content .= '<BR>';
         $content .= '<BR>';
-        $content .= '花材      数量/单价    金额  <BR>';
+        $content .= '花材       数量/单价    金额  <BR>';
         $content .= '--------------------------------<BR>';
         $content .= '--------------------------------<BR>';
 
 
         if (isset($respond['product']) && !empty($respond['product'])) {
         if (isset($respond['product']) && !empty($respond['product'])) {
@@ -471,7 +471,7 @@ class OrderClass extends BaseClass
             }
             }
         }
         }
         $content .= '--------------------------------<BR>';
         $content .= '--------------------------------<BR>';
-        if(isset($respond['sendCost']) && $respond['sendCost'] > 0){
+        if (isset($respond['sendCost']) && $respond['sendCost'] > 0) {
             $content .= '    运费:' . $respond['sendCost'] . '<BR>';
             $content .= '    运费:' . $respond['sendCost'] . '<BR>';
         }
         }
         $content .= '订单金额:' . $respond['prePrice'] . '<BR>';
         $content .= '订单金额:' . $respond['prePrice'] . '<BR>';
@@ -527,12 +527,25 @@ class OrderClass extends BaseClass
         if (isset($showItem['list']) && !empty($showItem['list'])) {
         if (isset($showItem['list']) && !empty($showItem['list'])) {
             foreach ($showItem['list'] as $itemKey => $itemVal) {
             foreach ($showItem['list'] as $itemKey => $itemVal) {
                 $bigNum = $itemVal['bigNum'] ?? 0;
                 $bigNum = $itemVal['bigNum'] ?? 0;
+                $bigUnitPrice = $itemVal['unitPrice'] ?? 0;
+                $smallUnitPrice = $itemVal['smallUnitPrice'] ?? 0;
                 $smallNum = $itemVal['smallNum'] ?? 0;
                 $smallNum = $itemVal['smallNum'] ?? 0;
-                $printProduct[] = [
-                    'name' => $itemVal['name'] ?? '',
-                    'num' => $bigNum . '/' . $smallNum,
-                    'price' => $itemVal['price'] ?? '0.00'
-                ];
+                if ($bigNum > 0) {
+                    $bigTotalPrice = bcmul($bigUnitPrice, $bigNum, 2);
+                    $printProduct[] = [
+                        'name' => $itemVal['name'] ?? '',
+                        'num' => $bigNum . '/' . $bigUnitPrice,
+                        'price' => $bigTotalPrice
+                    ];
+                }
+                if ($smallNum > 0) {
+                    $smallTotalPrice = bcmul($smallUnitPrice, $smallNum, 2);
+                    $printProduct[] = [
+                        'name' => $itemVal['name'] ?? '',
+                        'num' => $smallNum . '/' . $smallUnitPrice,
+                        'price' => $smallTotalPrice
+                    ];
+                }
             }
             }
         }
         }