shish 3 недель назад
Родитель
Сommit
5db89bcc80
1 измененных файлов с 10 добавлено и 1 удалено
  1. 10 1
      app-hd/controllers/GhsController.php

+ 10 - 1
app-hd/controllers/GhsController.php

@@ -500,7 +500,16 @@ class GhsController extends BaseController
 
     public function actionCommonInfo()
     {
-        $mainId = $this->resolveGhsMainId();
+        $get = Yii::$app->request->get();
+        $ghsId = intval($get['ghsId'] ?? 0);
+        $ghs = GhsClass::getById($ghsId);
+        if(empty($ghs)){
+            util::fail('没有批发店信息');
+        }
+        if($ghs['ownMainId'] != $this->mainId){
+            util::fail('不是你的批发店');
+        }
+        $mainId = $ghs['mainId'] ?? 0;
         // 通用接口返回全部有效公告,前端按 positions 字段筛选展示位置
         $ghsNoticeList = GhsNoticeClass::getClientNoticeList($mainId);
         util::success(['ghsNoticeList' => $ghsNoticeList]);