shish 1 vuosi sitten
vanhempi
commit
9bd5df092b

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

@@ -535,7 +535,7 @@ class OrderController extends BaseController
             $post['sendType'] = dict::getDict('sendType', 'shopGet');
         }
 
-        $forward = $post['forward'] ?? 1;
+        $forward = $post['forward'] ?? 0;
         if ($forward == 1) {
             if ($hasPay != 1) {
                 util::fail('负数订单只能线下转账');

+ 12 - 1
app-mall/controllers/CategoryController.php

@@ -13,14 +13,20 @@ use common\components\util;
 class CategoryController extends BaseController
 {
 
+    public $guestAccess = ['list', 'goods-list'];
+
     //获取分类 ssh 2019.12.2
     public function actionList()
     {
+        $user = $this->user;
+        if (empty($user)) {
+            util::success([]);
+        }
 
         //普莲花艺、叶上花、丰行、小武鲜花、九江云朵、源花汇、紫荆不能在花卉宝下单,多处要同步修改,关键词ls_mall_not_open
         $mainId = $this->mainId;
         if (getenv('YII_ENV') == 'production') {
-            if (in_array($mainId, [40057, 7779, 42940, 26374,10536, 65381])) {
+            if (in_array($mainId, [40057, 7779, 42940, 26374, 10536, 65381])) {
                 util::fail('暂无商品哦,编号25395');
             }
         } else {
@@ -42,6 +48,11 @@ class CategoryController extends BaseController
     //取分类下商品 ssh 2019.12.2
     public function actionGoodsList()
     {
+        $user = $this->user;
+        if (empty($user)) {
+            util::success(['list' => []]);
+        }
+
         $categoryId = Yii::$app->request->get('categoryId');
         if (empty($categoryId)) {
             util::fail('没有找到分类');

+ 1 - 1
app-mall/controllers/HdController.php

@@ -11,7 +11,7 @@ use Yii;
 class HdController extends BaseController
 {
 
-    public $guestAccess = ['list'];
+    public $guestAccess = ['list', 'info'];
 
     //花店详情 ssh 20250627
     public function actionDetail()

+ 8 - 3
app-mall/controllers/ItemController.php

@@ -15,7 +15,7 @@ use Yii;
 class ItemController extends BaseController
 {
 
-    public $guestAccess = ['show-info'];
+    public $guestAccess = ['show-info', 'index'];
 
     public function actionAll()
     {
@@ -111,14 +111,19 @@ class ItemController extends BaseController
         $delStatus = Yii::$app->request->get('delStatus', 0);
 
         $shop = $this->shop;
-        if (isset($shop->ptStyle) == false || $shop->ptStyle != 1) {
+        if (!isset($shop->ptStyle) || $shop->ptStyle != 1) {
             util::fail('访问门店出错了');
         }
 
+        $user = $this->user;
+        if (empty($user)) {
+            util::success([]);
+        }
+
         //普莲花艺、叶上花、丰行、小武鲜花、九江云朵、源花汇、紫荆不能在花卉宝下单,多处要同步修改,关键词ls_mall_not_open
         $mainId = $this->mainId;
         if (getenv('YII_ENV') == 'production') {
-            if (in_array($mainId, [40057, 7779, 42940, 26374,10536, 65381])) {
+            if (in_array($mainId, [40057, 7779, 42940, 26374, 10536, 65381])) {
                 util::fail('暂时无法访问');
             }
         } else {

+ 18 - 12
app-mall/controllers/ShopController.php

@@ -21,6 +21,8 @@ use common\components\util;
 class ShopController extends BaseController
 {
 
+    public $guestAccess = ['info'];
+
     //门店详情 ssh 20230210
     public function actionInfo()
     {
@@ -34,21 +36,25 @@ class ShopController extends BaseController
         } else {
             $info['superWx'] = '';
         }
-        $shortAvatar = $info['avatar']??'';
-        $avatar = imgUtil::groupImg($shortAvatar). "?x-oss-process=image/resize,m_fill,h_300,w_300";
+        $shortAvatar = $info['avatar'] ?? '';
+        $avatar = imgUtil::groupImg($shortAvatar) . "?x-oss-process=image/resize,m_fill,h_300,w_300";
         $info['avatar'] = $avatar;
         $info['shortAvatar'] = $shortAvatar;
 
-        if (empty($hdId)) {
-            $user = $this->user;
-            $shop = $this->shop;
-            $respond = CustomClass::buildRelation($shop, $user);
-            $hd = $respond['hd'];
-            $custom = $respond['custom'];
-        }else{
-            $hd = HdClass::getById($hdId, true);
-            $customId = $hd->customId;
-            $custom = CustomClass::getById($customId, true);
+        $user = $this->user;
+        $hd = [];
+        $custom = [];
+        if (!empty($user)) {
+            if (empty($hdId)) {
+                $shop = $this->shop;
+                $respond = CustomClass::buildRelation($shop, $user);
+                $hd = $respond['hd'];
+                $custom = $respond['custom'];
+            } else {
+                $hd = HdClass::getById($hdId, true);
+                $customId = $hd->customId;
+                $custom = CustomClass::getById($customId, true);
+            }
         }
 
         util::success(['info' => $info, 'hd' => $hd, 'custom' => $custom]);