shish 1 year ago
parent
commit
b27344791b
2 changed files with 8 additions and 1 deletions
  1. 5 1
      app-hd/controllers/WorkController.php
  2. 3 0
      biz-hd/goods/classes/GoodsClass.php

+ 5 - 1
app-hd/controllers/WorkController.php

@@ -204,7 +204,11 @@ class WorkController extends BaseController
         $goods = [];
         $goodsId = $work->goodsId ?? 0;
         if (!empty($goodsId)) {
-            $goods = GoodsClass::getGoodsInfo($goodsId);
+            $params = [];
+            $shop = $this->shop;
+            //这边传的是空的,有影响,后面要解决,请搜索关键词 work_if_need_custom
+            $custom = [];
+            $goods = GoodsClass::getGoodsInfo($goodsId, $shop, $custom, $params);
         }
         $work = $work->attributes;
         $shortCover = $work['cover'] ?? '';

+ 3 - 0
biz-hd/goods/classes/GoodsClass.php

@@ -373,6 +373,9 @@ class GoodsClass extends BaseClass
     //会返回两个参数 price 价格或涨价后的价格 priceBeforeRise 涨价前的价格,如果price==priceBeforeRise说明没有涨价
     public static function obeyRiseRule($data, $riseSwitch, $riseType, $riseAmount, $custom, $params)
     {
+
+        //注意制作单那边也会调到这个方法 $custom暂时传的是空的,搜索关键词 work_if_need_custom !!!!!!!!!!!!!!!!!!!!!
+
         $price = $data['price'] ?? 0;
         $priceBeforeRise = $price;
         //后台修改商品时,取原价,不需要显示涨价金额 getOriginalPrice=1 有涨价也强制取原价