shish 3 месяцев назад
Родитель
Сommit
0f351dd547
1 измененных файлов с 12 добавлено и 1 удалено
  1. 12 1
      app-hd/controllers/PurchaseController.php

+ 12 - 1
app-hd/controllers/PurchaseController.php

@@ -1300,8 +1300,19 @@ class PurchaseController extends BaseController
     {
         $get = Yii::$app->request->get();
         $id = $get['id'] ?? 0;
+        $salt = $get['salt'] ?? '';
         $info = GhsClass::getGhsInfo($id);
-        GhsClass::valid($info, $this->shopId);
+
+        if (!empty($salt)) {
+            if (!isset($info['salt']) || $info['salt'] != $salt) {
+                util::fail('供货商出错了');
+            }
+        } else {
+            if (!isset($info['ownShopId']) || $info['ownShopId'] != $this->shopId) {
+                util::fail('错误的供货商.');
+            }
+        }
+
         $where = ['ghsId' => $id, 'debt' => PurchaseClass::DEBT_YES];
         $searchTime = $get['searchTime'] ?? '';
         if (!empty($searchTime)) {