ShopController.php 970 B

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