Ver código fonte

公告说明

shish 8 meses atrás
pai
commit
686e842bab
1 arquivos alterados com 6 adições e 5 exclusões
  1. 6 5
      app-ghs/controllers/PicTextController.php

+ 6 - 5
app-ghs/controllers/PicTextController.php

@@ -80,14 +80,15 @@ class PicTextController extends BaseController
         if (empty($ext)) {
             util::fail('门店信息缺失呢');
         }
+        //允许打开公告,但不设置公告详情的图文
+        $ext->purchaseGuide = $picTextId;
+        $shop = $this->shop;
         if ($switch == 1) {
-            if (empty($picTextId) || !is_numeric($picTextId)) {
-                util::fail('请选择图文');
-            }
-            $ext->purchaseGuide = $picTextId;
+            $shop->buyNotice = 1;
         } else {
-            $ext->purchaseGuide = 0;
+            $shop->buyNotice = 0;
         }
+        $shop->save();
         $ext->purchaseGuideText = $purchaseGuideText;
         $ext->save();
         util::complete('修改成功');