MerchantController.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 actionIntroduceShop()
  30. {
  31. $id = Yii::$app->request->get('id');
  32. $merchant = MerchantService::getMerchantById($id);
  33. if (empty($merchant)) {
  34. util::fail('没有找到介绍人');
  35. }
  36. $merchantName = isset($merchant['merchantName']) ? $merchant['merchantName'] : '';
  37. $smallLogoUrl = isset($merchant['smallLogoUrl']) ? $merchant['smallLogoUrl'] : '';
  38. $logoUrl = isset($merchant['logoUrl']) ? $merchant['logoUrl'] : '';
  39. $data = ['merchantName' => $merchantName, 'smallLogoUrl' => $smallLogoUrl, 'id' => $id, 'logoUrl' => $logoUrl, 'fullAddress' => '暂无'];
  40. util::success($data);
  41. }
  42. }