shish 4 years ago
parent
commit
e8240e7c93

+ 1 - 1
app-hd/controllers/ProductController.php

@@ -196,7 +196,7 @@ class ProductController extends BaseController
         $ghs = GhsClass::getById($ghsId, true);
         GhsClass::valid($ghs, $this->shopId);
         $shopId = $ghs->shopId ?? 0;
-        $product = ProductClass::getItemInfo($id);
+        $product = ProductClass::getItemInfo($id, $ghs);
         if (isset($product['shopId']) == false || $product['shopId'] != $shopId) {
             util::fail('没有权限访问');
         }

+ 3 - 2
biz-ghs/product/classes/ProductClass.php

@@ -85,13 +85,14 @@ class ProductClass extends BaseClass
     }
 
     //获取详情 ruidian 2021.5.3
-    public static function getItemInfo($id)
+    public static function getItemInfo($id, $ghs = [])
     {
         $info = self::getById($id);
         if (empty($info)) {
             return $info;
         }
-        $list = self::groupProductInfo([$info]);
+        $level = $ghs->giveLevel ?? 0;
+        $list = self::groupProductInfo([$info], $level);
         return current($list);
     }