| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- <?php
- namespace pt\controllers;
- use biz\sj\classes\MerchantExtendClass;
- use biz\sj\services\MerchantAssetService;
- use biz\sj\services\MerchantExtendService;
- use biz\sj\services\MerchantService;
- use bizHd\merchant\services\ShopService;
- use bizHd\retail\services\RetailAssetService;
- use bizHd\user\services\UserService;
- use common\components\dirUtil;
- use common\components\httpUtil;
- use common\components\imgUtil;
- use common\components\qrCodeUtil;
- use common\components\util;
- use common\components\wxUtil;
- 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>'] = 0;
- break;
- default:
- }
- $list = UserService::getUserList($where);
- $asset = RetailAssetService::getAsset();
- $list['asset'] = $asset;
- util::success($list);
- }
-
- //客户列表 ssh 2019.11.30
- public function actionOaList()
- {
- $get = Yii::$app->request->get();
- $type = isset($get['type']) ? $get['type'] : -1;
- $sjId = 12358;
- $where = ['sjId' => $sjId];
- switch ($type) {
- case 1:
- //粉丝
- $where['subscribe'] = 1;
- break;
- case 2:
- //会员
- $where['member>'] = 0;
- break;
- default:
- }
- $list = UserService::getUserList($where);
- $merchantAsset = MerchantAssetService::getBySjId($sjId);
- $list['asset'] = $merchantAsset;
- util::success($list);
- }
-
- //会员申请码查看 ssh 2020.2.15
- public function actionApplyCode()
- {
- $id = Yii::$app->request->get('id');
- $shop = ShopService::getById($id);
- $sjId = isset($shop['sjId']) ? $shop['sjId'] : 0;
- if (empty($sjId)) {
- util::fail('没有找到商家');
- }
- $url = MerchantExtendClass::getApplyMemberCode($sjId);
- echo "会员申请码:<br /><br /><img width='300' src='{$url}' /><br /><br />";
- echo "未上线的小程序体验码:<br /><br />";
- $merchant = MerchantService::getMerchantById($sjId);
- wxUtil::getExperienceQrCode($merchant);
- }
-
- //收款码查看 ssh 2020.2.20
- public function actionGatheringCode()
- {
- $id = Yii::$app->request->get('id');
- $shop = ShopService::getById($id);
- $sjId = isset($shop['sjId']) ? $shop['sjId'] : 0;
- if (empty($sjId)) {
- util::fail('没有找到商家');
- }
- $gatheringCode = isset($shop['gatheringCode']) ? $shop['gatheringCode'] : '';
- $file = dirUtil::getImgDir() . $gatheringCode;
- $url = Yii::$app->params['mallDomain'] . "/#/pages/pay/index?account={$sjId}&shopId=" . $id;
- $url = httpUtil::becomeHttps($url);
- if (empty($gatheringCode) || file_exists($file) == false) {
- //强制转成https
- $gatheringCode = qrCodeUtil::generateGatheringQrCode($url, $sjId, $id, '', 10);
- ShopService::updateById($id, ['gatheringCode' => $gatheringCode]);
- }
- $imgUrl = imgUtil::getPrefix() . $gatheringCode;
- echo '<br /><br />收款码<br /><br />';
- echo "<img width='300' src='{$imgUrl}' /><br /><br />";
- echo $url;
- $mall = Yii::$app->params['mallDomain'] . "/#/?account=" . $sjId;
- echo "<br /><br />商城首页:<br />" . httpUtil::becomeHttps($mall);
- }
-
- }
|