| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace www\controllers;
- use biz\admin\services\AdminService;
- use biz\merchant\services\MerchantService;
- use common\components\util;
- use Yii;
- class MerchantController extends BaseController
- {
-
- //商家列表 shish 2019.12.20
- public function actionList()
- {
- $where = [];
- $list = MerchantService::getSaasMerchant($where);
- util::success($list);
- }
-
- //获取当前登陆老板的帐号详情,官网购买套餐时使用 shish 2020.1.11
- public function actionLoginAccount()
- {
- $userId = $this->userId;
- $admin = AdminService::getByCondition(['platUserId' => $userId]);
- if (empty($admin)) {
- util::fail('没有找到注册信息');
- }
- $merchantId = $admin['merchantId'];
- $merchant = MerchantService::getMerchantById($merchantId);
- util::success($merchant);
- }
-
- //商家信息 shish 2020.1.11
- public function actionIntroduceShop()
- {
- $id = Yii::$app->request->get('id');
- $merchant = MerchantService::getMerchantById($id);
- if (empty($merchant)) {
- util::fail('没有找到介绍人');
- }
- $merchantName = isset($merchant['merchantName']) ? $merchant['merchantName'] : '';
- $smallLogoUrl = isset($merchant['smallLogoUrl']) ? $merchant['smallLogoUrl'] : '';
- $logoUrl = isset($merchant['logoUrl']) ? $merchant['logoUrl'] : '';
- $data = ['merchantName' => $merchantName, 'smallLogoUrl' => $smallLogoUrl, 'id' => $id, 'logoUrl' => $logoUrl, 'fullAddress' => '暂无'];
- util::success($data);
- }
-
- }
|