| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?php
- namespace saas\controllers;
- use biz\merchant\classes\MerchantExtendClass;
- use biz\merchant\services\MerchantAssetService;
- use biz\merchant\services\ShopService;
- use biz\retail\services\RetailAssetService;
- use biz\user\services\UserService;
- use common\components\httpUtil;
- use common\components\qrCodeUtil;
- use common\components\util;
- use Yii;
- class UserController extends BaseController
- {
-
- public function actionList()
- {
- $get = Yii::$app->request->get();
- $type = isset($get['type']) ? $get['type'] : -1;
- $where = [];
- switch ($type) {
- case 1:
- //粉丝
- $where['subscribe'] = 1;
- break;
- case 2:
- //会员
- $where['member>'] = -1;
- break;
- default:
- }
- $list = UserService::getUserList($where);
- $asset = RetailAssetService::getAsset();
- $list['asset'] = $asset;
- util::success($list);
- }
-
- //客户列表 shish 2019.11.30
- public function actionOaList()
- {
- $get = Yii::$app->request->get();
- $type = isset($get['type']) ? $get['type'] : -1;
- $merchantId = 12358;
- $where = ['merchantId' => $merchantId];
- switch ($type) {
- case 1:
- //粉丝
- $where['subscribe'] = 1;
- break;
- case 2:
- //会员
- $where['member>'] = -1;
- break;
- default:
- }
- $list = UserService::getUserList($where);
- $merchantAsset = MerchantAssetService::getByMerchantId($merchantId);
- $list['asset'] = $merchantAsset;
- util::success($list);
- }
-
- //会员申请码查看 shish 2020.2.15
- public function actionApplyCode()
- {
- $id = Yii::$app->request->get('id');
- $shop = ShopService::getById($id);
- $merchantId = isset($shop['merchantId']) ? $shop['merchantId'] : 0;
- if (empty($merchantId)) {
- util::fail('没有找到商家');
- }
- $url = MerchantExtendClass::getApplyMemberCode($merchantId);
- echo "<img width='300' src='{$url}' />";
- }
-
- //收款码查看 shish 2020.2.20
- public function actionGatheringCode()
- {
- $id = Yii::$app->request->get('id');
- $shop = ShopService::getById($id);
- $merchantId = isset($shop['merchantId']) ? $shop['merchantId'] : 0;
- if (empty($merchantId)) {
- util::fail('没有找到商家');
- }
- $url = Yii::$app->params['mDomain'] . "/#/pages/pay/index?account={$merchantId}&shopId=" . $id;
- //强制转成https
- $url = httpUtil::becomeHttps($url);
- $logo = !empty($this->merchant['logo']) ? $webRoot . $this->merchant['logo'] : '';
- $gatheringQrcodeUrl = qrCodeUtil::generate($url, $unique, $logo, 10);
- }
- }
|