Ver código fonte

fix bug: 花掌柜花店打开商品详情,报没有权限访问

shizhongqi 4 anos atrás
pai
commit
c1d674356b
1 arquivos alterados com 3 adições e 3 exclusões
  1. 3 3
      app-hd/controllers/ProductController.php

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

@@ -382,11 +382,11 @@ class ProductController extends BaseController
         $ghsId = Yii::$app->request->get('ghsId', 0);
         $ghs = GhsClass::getById($ghsId, true);
         GhsClass::valid($ghs, $this->shopId);
-        $shopId = $ghs->shopId ?? 0;
+        $mainId = $ghs->mainId ?? 0;
         $product = ProductClass::getItemInfo($id, $ghs);
-        if (isset($product['shopId']) == false || $product['shopId'] != $shopId) {
+        if (isset($product['mainId']) == false || $product['mainId'] != $mainId) {
             Yii::info(json_encode($product));
-            Yii::info('shopId: ' . $shopId);
+            Yii::info('mainId: ' . $mainId);
             util::fail('没有权限访问');
         }
         $original = ProductClass::getById($id);