|
|
@@ -28,7 +28,7 @@ class UserController extends BaseController
|
|
|
//组建where
|
|
|
$type = isset($get['type']) ? $get['type'] : -1;
|
|
|
$search = isset($get['search']) ? $get['search'] : '';
|
|
|
- $where = ['merchantId' => $this->merchantId];
|
|
|
+ $where = ['merchantId' => $this->sjId];
|
|
|
switch ($type) {
|
|
|
case 1:
|
|
|
//粉丝
|
|
|
@@ -48,7 +48,7 @@ class UserController extends BaseController
|
|
|
}
|
|
|
}
|
|
|
$list = UserService::getUserList($where);
|
|
|
- $list['asset'] = MerchantAssetService::getByMerchantId($this->merchantId);
|
|
|
+ $list['asset'] = MerchantAssetService::getByMerchantId($this->sjId);
|
|
|
util::success($list);
|
|
|
}
|
|
|
|
|
|
@@ -57,7 +57,7 @@ class UserController extends BaseController
|
|
|
{
|
|
|
$userId = Yii::$app->request->get('userId');
|
|
|
$info = UserService::getUserInfo($userId);
|
|
|
- if (isset($info['merchantId']) == false || $this->merchantId != $info['merchantId']) {
|
|
|
+ if (isset($info['merchantId']) == false || $this->sjId != $info['merchantId']) {
|
|
|
util::fail('没有权限');
|
|
|
}
|
|
|
util::success($info);
|
|
|
@@ -68,7 +68,7 @@ class UserController extends BaseController
|
|
|
{
|
|
|
$userId = Yii::$app->request->get('userId');
|
|
|
$info = UserService::getFullUserInfo($userId);
|
|
|
- UserService::valid($info, $this->merchantId);
|
|
|
+ UserService::valid($info, $this->sjId);
|
|
|
|
|
|
$list = MerchantRemarkService::getRemarkList($userId);
|
|
|
$info['remarkList'] = $list;
|
|
|
@@ -90,12 +90,12 @@ class UserController extends BaseController
|
|
|
AdminService::verifyConfirmPassword($this->adminId, $confirmPassword);
|
|
|
|
|
|
$mobile = $post['mobile'];
|
|
|
- $user = UserService::getByMobile($mobile, $this->merchantId);
|
|
|
+ $user = UserService::getByMobile($mobile, $this->sjId);
|
|
|
if (!empty($user)) {
|
|
|
util::fail('手机号已使用');
|
|
|
}
|
|
|
|
|
|
- $post['merchantId'] = $this->merchantId;
|
|
|
+ $post['merchantId'] = $this->sjId;
|
|
|
$post['member'] = $post['memberLevel'];
|
|
|
UserService::addUser($post);
|
|
|
|
|
|
@@ -115,7 +115,7 @@ class UserController extends BaseController
|
|
|
if (empty($user)) {
|
|
|
util::fail('找不到客户');
|
|
|
}
|
|
|
- if ($user['merchantId'] != $this->merchantId) {
|
|
|
+ if ($user['merchantId'] != $this->sjId) {
|
|
|
util::fail('您没有权限操作');
|
|
|
}
|
|
|
$userAsset = UserAssetService::getByUserId($userId);
|
|
|
@@ -123,8 +123,8 @@ class UserController extends BaseController
|
|
|
$totalRecharge = $userAsset['totalRecharge'] + $rechargeAmount;
|
|
|
$upData['balance'] = $totalBalance;
|
|
|
$upData['totalRecharge'] = $totalRecharge;
|
|
|
- $merchantAsset = MerchantAssetService::getByMerchantId($this->merchantId);
|
|
|
- $return = xhRechargeService::recharge($rechargeAmount, $user, $this->adminId, $this->merchant, $this->merchantExtend, $merchantAsset);
|
|
|
+ $merchantAsset = MerchantAssetService::getByMerchantId($this->sjId);
|
|
|
+ $return = xhRechargeService::recharge($rechargeAmount, $user, $this->adminId, $this->sj, $this->sjExtend, $merchantAsset);
|
|
|
if ($return['code'] == 'A0001') {
|
|
|
util::complete();
|
|
|
}
|
|
|
@@ -142,12 +142,12 @@ class UserController extends BaseController
|
|
|
util::fail('客户不存在');
|
|
|
}
|
|
|
//验证是否商家客户
|
|
|
- UserService::valid($user, $this->merchantId);
|
|
|
+ UserService::valid($user, $this->sjId);
|
|
|
//验证确认密码
|
|
|
$confirmPassword = $post['confirmPassword'];
|
|
|
AdminService::verifyConfirmPassword($this->adminId, $confirmPassword);
|
|
|
|
|
|
- $grade = xhMerchantExtendService::getGradeList($this->merchantExtend, 'desc');
|
|
|
+ $grade = xhMerchantExtendService::getGradeList($this->sjExtend, 'desc');
|
|
|
//升级后的成长值
|
|
|
$newLevelGrowth = $grade[$member]['growth'];
|
|
|
$newDiscount = $grade[$member]['discount'];
|
|
|
@@ -173,7 +173,7 @@ class UserController extends BaseController
|
|
|
$upgradeData = [
|
|
|
'member' => $member,
|
|
|
'prevMember' => $userAsset['member'],
|
|
|
- 'merchantId' => $this->merchantId,
|
|
|
+ 'merchantId' => $this->sjId,
|
|
|
'gainType' => 0,
|
|
|
'addTime' => $now,
|
|
|
'userId' => $userId,
|
|
|
@@ -183,7 +183,7 @@ class UserController extends BaseController
|
|
|
$growthData = [
|
|
|
'userId' => $userId,
|
|
|
'userName' => $user['userName'],
|
|
|
- 'merchantId' => $this->merchantId,
|
|
|
+ 'merchantId' => $this->sjId,
|
|
|
'relateId' => $upgradeRespond['id'],
|
|
|
'growth' => $newLevelGrowth,
|
|
|
'num' => $addGrowth,
|
|
|
@@ -202,7 +202,7 @@ class UserController extends BaseController
|
|
|
$transaction->rollBack();
|
|
|
util::fail();
|
|
|
}
|
|
|
- $allTM = xhTMessageService::getList($this->merchantId);
|
|
|
+ $allTM = xhTMessageService::getList($this->sjId);
|
|
|
$openId = isset($user['openId']) ? $user['openId'] : '';
|
|
|
if (empty($openId)) {
|
|
|
util::complete();
|
|
|
@@ -220,7 +220,7 @@ class UserController extends BaseController
|
|
|
"keyword2" => ["value" => $date, "color" => "#173177"],
|
|
|
"remark" => ["value" => "点击查看会员权益", "color" => "#173177"],
|
|
|
]];
|
|
|
- wxUtil::sendTaskInform($data, $this->merchant);
|
|
|
+ wxUtil::sendTaskInform($data, $this->sj);
|
|
|
util::complete();
|
|
|
}
|
|
|
|
|
|
@@ -231,7 +231,7 @@ class UserController extends BaseController
|
|
|
$userId = isset($post['userId']) ? $post['userId'] : 0;
|
|
|
$password = isset($post['password']) ? $post['password'] : 0;
|
|
|
$info = UserService::getById($userId);
|
|
|
- UserService::valid($info, $this->merchantId);
|
|
|
+ UserService::valid($info, $this->sjId);
|
|
|
UserService::updateById($userId, ['payPassword' => password_hash($password, PASSWORD_BCRYPT)]);
|
|
|
util::complete();
|
|
|
}
|