PublicController.php 757 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace mall\controllers;
  3. use biz\merchant\services\MerchantService;
  4. use common\components\baseController;
  5. use common\components\httpUtil;
  6. /**
  7. * 前台公共类
  8. */
  9. class PublicController extends baseController
  10. {
  11. public $webTitle = '花卉宝';
  12. public $webDescription = '花卉宝';
  13. public $webKeyword = '花卉宝';
  14. public $version;//公共静态文件版本号
  15. public $merchant, $merchantId;
  16. public function beforeAction($action)
  17. {
  18. $this->version = '1.0.0';
  19. $header = httpUtil::getHeader();
  20. $account = isset($header['account']) ? $header['account'] : 0;
  21. if (!empty($account)) {
  22. $this->merchantId = $account;
  23. $this->merchant = MerchantService::getMerchantById($account);
  24. }
  25. return parent::beforeAction($action);
  26. }
  27. }