| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?php
- namespace admin\controllers;
- use biz\admin\services\AdminService;
- use biz\user\services\UserService;
- use Yii;
- use common\components\stringUtil;
- use common\components\util;
- class UserController extends BaseController
- {
-
- public $enableCsrfValidation = false;
-
- //客户列表 shish 2019.11.30
- public function actionGetList()
- {
- $get = Yii::$app->request->get();
-
- //组建where
- $type = isset($get['type']) ? $get['type'] : 0;
- $search = isset($get['search']) ? $get['search'] : '';
- $where = ['merchantId' => $this->merchantId];
- switch ($type) {
- case 1:
- //粉丝
- $where['subscribe'] = 1;
- break;
- case 2:
- //会员
- $where['isMember'] = 1;
- break;
- default:
- }
- if (!empty($search)) {
- if (stringUtil::isMobieNumber($search)) {
- $where['mobile'] = $search;
- } else {
- $where['userName'] = ['like', $search];
- }
- }
- $list = UserService::getUserList($where);
- util::success($list);
- }
-
- //获取客户基本和资产信息 shish 2019.11.30
- public function actionGetInfo()
- {
- $userId = Yii::$app->request->get('userId');
- $info = UserService::getUserInfo($userId);
- if (isset($info['merchantId']) == false || $this->merchantId != $info['merchantId']) {
- util::fail('没有权限');
- }
- util::success($info);
- }
-
- //获取客户基本、资产和订单完整信息 2019.11.30
- public function actionGetFullInfo()
- {
- $userId = Yii::$app->request->get('userId');
- $info = UserService::getFullUserInfo($userId);
- if (isset($info['merchantId']) == false || $this->merchantId != $info['merchantId']) {
- util::fail('没有权限');
- }
- util::success($info);
- }
-
- //添加客户,申请会员时会自动同步资产 shish 2019.11.30
- public function actionAdd()
- {
- $post = Yii::$app->request->post();
- if ($post['mobile'] != $post['confirmMobile']) {
- util::fail('二次输入手机号不一样');
- }
- $confirmPassword = isset($post['confirmPassword']) ? $post['confirmPassword'] : '';
- $verify = AdminService::verifyConfirmPassword($this->adminId, $confirmPassword);
- if ($verify == false) {
- util::fail('密码错误');
- }
-
- }
-
- }
|