shish преди 4 години
родител
ревизия
7192d622df
променени са 2 файла, в които са добавени 2 реда и са изтрити 4 реда
  1. 1 3
      app-ghs/controllers/StockController.php
  2. 1 1
      app-hd/controllers/StockController.php

+ 1 - 3
app-ghs/controllers/StockController.php

@@ -17,12 +17,10 @@ class StockController extends BaseController
     {
     {
         $get = Yii::$app->request->get();
         $get = Yii::$app->request->get();
         $id = $get['id'] ?? 0;
         $id = $get['id'] ?? 0;
-
         $product = ProductClass::getById($id, true);
         $product = ProductClass::getById($id, true);
-        if (isset($product->shopId) == false || $product->shopId != $this->shopId || $product->mainId != $this->mainId) {
+        if (isset($product->mainId) == false || $product->mainId != $this->mainId) {
             util::fail('没有权限');
             util::fail('没有权限');
         }
         }
-
         $where = ['productId' => $id];
         $where = ['productId' => $id];
         $searchTime = $get['searchTime'] ?? '';
         $searchTime = $get['searchTime'] ?? '';
         if (!empty($searchTime)) {
         if (!empty($searchTime)) {

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

@@ -18,7 +18,7 @@ class StockController extends BaseController
         $get = Yii::$app->request->get();
         $get = Yii::$app->request->get();
         $id = $get['id'] ?? 0;
         $id = $get['id'] ?? 0;
         $product = ProductClass::getById($id, true);
         $product = ProductClass::getById($id, true);
-        if ($product->mainId != $this->mainId) {
+        if (isset($product->mainId) == false || $product->mainId != $this->mainId) {
             util::fail('没有权限');
             util::fail('没有权限');
         }
         }
         $where = ['productId' => $id];
         $where = ['productId' => $id];