|
|
@@ -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]);
|