ShopController.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace mall\controllers;
  3. use bizMall\ad\services\AdService;
  4. use bizMall\goods\services\CategoryService;
  5. use bizMall\goods\services\GoodsCategoryService;
  6. use bizMall\invite\services\InviteService;
  7. use bizMall\merchant\services\MerchantService;
  8. use bizMall\merchant\services\ShopService;
  9. use bizMall\user\services\UserService;
  10. use Yii;
  11. use yii\web\Controller;
  12. use common\components\util;
  13. class ShopController extends BaseController
  14. {
  15. //获取商家的默认门店 ssh 2019.12.6
  16. public function actionDetail()
  17. {
  18. $introUserId = Yii::$app->request->get('introUserId');
  19. $shop = isset($this->shop) && !empty($this->shop) ? $this->shop->attributes : [];
  20. $ad = [
  21. ['adImgUrl' => 'https://img.theflorist.cn/example/shop/1.jpg']
  22. ];
  23. //新人专享礼物
  24. $newUserGift = [];
  25. if (!empty($introUserId)) {
  26. $userInfo = UserService::getUserInfo($this->userId);
  27. $newUserGift = InviteService::hasNewGift($userInfo);
  28. }
  29. util::success(['ad' => $ad, 'shop' => $shop, 'newUserGift' => $newUserGift]);
  30. }
  31. }