SellerController.php 750 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace app\common\controller;
  3. use Lettered\Support\Auth as IAuth;
  4. use think\App;
  5. class SellerController extends BaseController
  6. {
  7. /**
  8. * @var null
  9. */
  10. protected $auth = null;
  11. /**
  12. * @var mixed|null
  13. */
  14. protected $seller = null;
  15. /**
  16. * SellerController constructor.
  17. * @param App|null $app
  18. * @param IAuth $auth
  19. * @throws \Lettered\Support\Exceptions\FailedException
  20. */
  21. public function __construct(App $app = null,IAuth $auth)
  22. {
  23. parent::__construct($app);
  24. $this->auth = $auth->guard('user');
  25. // 读取商户
  26. $this->seller = model('common/Seller')->getBy(['user_id' => $this->auth->user()['id']]);
  27. }
  28. }