MerchantController.php 988 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace www\controllers;
  3. use biz\admin\services\AdminService;
  4. use biz\merchant\services\MerchantService;
  5. use common\components\util;
  6. use Yii;
  7. class MerchantController extends BaseController
  8. {
  9. //商家列表 shish 2019.12.20
  10. public function actionList()
  11. {
  12. $where = [];
  13. $list = MerchantService::getSaasMerchant($where);
  14. util::success($list);
  15. }
  16. //获取当前登陆老板的帐号详情,官网购买套餐时使用 shish 2020.1.11
  17. public function actionLoginAccount()
  18. {
  19. $userId = $this->userId;
  20. $admin = AdminService::getByCondition(['platUserId' => $userId]);
  21. if (empty($admin)) {
  22. util::fail('没有找到注册信息');
  23. }
  24. $merchantId = $admin['merchantId'];
  25. $merchant = MerchantService::getMerchantById($merchantId);
  26. util::success($merchant);
  27. }
  28. //商家信息 shish 2020.1.11
  29. public function actionDetail()
  30. {
  31. $id = Yii::$app->request->get('id');
  32. $merchant = MerchantService::getMerchantById(12358);
  33. util::success($merchant);
  34. }
  35. }