| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace mall\controllers;
- use bizHd\shop\classes\ShopClass;
- use bizMall\ad\services\AdService;
- use bizMall\goods\services\CategoryService;
- use bizMall\goods\services\GoodsCategoryService;
- use bizMall\invite\services\InviteService;
- use bizMall\merchant\services\MerchantService;
- use bizMall\merchant\services\ShopService;
- use bizMall\user\services\UserService;
- use common\components\imgUtil;
- use Yii;
- use yii\web\Controller;
- use common\components\util;
- class ShopController extends BaseController
- {
- //最新店铺 ssh 20220506
- public function actionGetNewShop()
- {
- $respond = ShopClass::getNewShopList();
- //显示国兰的信息 0不是 1是
- $showGlInfo = getenv('SHOW_GL_INFO');
- $info = $showGlInfo === false ? 1 : $showGlInfo;
- $respond['showGlInfo'] = $info;
- util::success($respond);
- }
- //获取商家的默认门店 ssh 2019.12.6
- public function actionDetail()
- {
- $introUserId = Yii::$app->request->get('introUserId');
- $shop = isset($this->shop) && !empty($this->shop) ? $this->shop->attributes : [];
- $ad = [];
- if (isset($this->shop->img) && !empty($this->shop->img) && $this->shop->img != '[]') {
- $arr = json_decode($this->shop->img, true);
- if (!empty($arr)) {
- foreach ($arr as $img) {
- $imgUrl = imgUtil::groupImg($img);
- $ad[] = ['adImgUrl' => $imgUrl];
- }
- }
- }
- //新人专享礼物
- $newUserGift = [];
- if (!empty($introUserId)) {
- $userInfo = UserService::getUserInfo($this->userId);
- $newUserGift = InviteService::hasNewGift($userInfo);
- }
- util::success(['ad' => $ad, 'shop' => $shop, 'newUserGift' => $newUserGift]);
- }
- }
|