Przeglądaj źródła

获取批发店的公告

shish 3 tygodni temu
rodzic
commit
5db89bcc80
1 zmienionych plików z 10 dodań i 1 usunięć
  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()
     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 字段筛选展示位置
         // 通用接口返回全部有效公告,前端按 positions 字段筛选展示位置
         $ghsNoticeList = GhsNoticeClass::getClientNoticeList($mainId);
         $ghsNoticeList = GhsNoticeClass::getClientNoticeList($mainId);
         util::success(['ghsNoticeList' => $ghsNoticeList]);
         util::success(['ghsNoticeList' => $ghsNoticeList]);