Ver Fonte

客户欠款

shish há 5 anos atrás
pai
commit
35688085b7
1 ficheiros alterados com 7 adições e 5 exclusões
  1. 7 5
      app-hd/controllers/OrderController.php

+ 7 - 5
app-hd/controllers/OrderController.php

@@ -94,20 +94,22 @@ class OrderController extends BaseController
                 }
                 $goodsPrice = $unitPrice * $goodsNum;
                 $totalGoodsPrice = stringUtil::calcAdd($totalGoodsPrice, $goodsPrice);
-
+                $currentCover = isset($goodsInfo['shortImgList']) && !empty($currentGoodsInfo['shortImgList']) ? current($currentGoodsInfo['shortImgList']) : '';
+                if (!empty($goodsStyleId) && isset($goodsStyleList[$goodsStyleId]['picture']) && !empty($goodsStyleList[$goodsStyleId]['picture'])) {
+                    $currentCover = $goodsStyleList[$goodsStyleId]['picture'];
+                }
                 $orderGoods[] = [
                     'goodsId' => $currentGoodsId,
                     'userId' => $this->adminId,
                     'sjId' => $this->sjId,
                     'title' => $currentGoodsInfo['goodsName'],
-                    'cover' => isset($goodsInfo['shortImgList']) && !empty($currentGoodsInfo['shortImgList']) ? current($currentGoodsInfo['shortImgList']) : '',
+                    'cover' => $currentCover,
                     'unitPrice' => $unitPrice,
                     'num' => $goodsNum,
                     'goodsStyleName' => isset($currentGoodsInfo['goodsStyleList'][$goodsStyleId]['title']) ? $currentGoodsInfo['goodsStyleList'][$goodsStyleId]['title'] : '',
                     'goodsStyleId' => $goodsStyleId,
                     'createTime' => date("Y-m-d H:i:s"),
                 ];
-
             }
 
             $user = $this->custom;
@@ -159,10 +161,10 @@ class OrderController extends BaseController
             if (empty($product)) {
                 util::fail('请选择花材');
             }
-            $actPrice = $post['packingFee']??0; //包装费
+            $actPrice = $post['packingFee'] ?? 0; //包装费
             $orderProduct = [];
             $productInfo = ProductClass::formatProductInfo($product);
-            $actPrice = bcadd($actPrice,$productInfo['price'],2);
+            $actPrice = bcadd($actPrice, $productInfo['price'], 2);
             foreach ($product as $key => $val) {
                 $productId = $val['productId'];
                 $bigNum = $val['bigNum'];