MerchantController.php 1.5 KB

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