多账号登录 更换手机号
This commit is contained in:
@@ -262,17 +262,17 @@ class Login extends Model
|
|||||||
if (md5($password) != $user_info['password']) {
|
if (md5($password) != $user_info['password']) {
|
||||||
return ['code' => 0, 'msg' => '密码错误', 'data' => null];
|
return ['code' => 0, 'msg' => '密码错误', 'data' => null];
|
||||||
}
|
}
|
||||||
$multi_user = [];
|
// $multi_user = [];
|
||||||
//查询手机号绑定的账号
|
// //查询手机号绑定的账号
|
||||||
$phone_user = $this->phone_login_query($user_name);
|
// $phone_user = $this->phone_login_query($user_name);
|
||||||
if($phone_user['code'] == 1){
|
// if($phone_user['code'] == 1){
|
||||||
//获取返回数据的长度
|
// //获取返回数据的长度
|
||||||
if(count($phone_user['data']) >= 2){
|
// if(count($phone_user['data']) >= 2){
|
||||||
$multi_user = $phone_user['data'];
|
// $multi_user = $phone_user['data'];
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
$login = $this->login($user_info,$system,$login_device,$multi_user);
|
$login = $this->login($user_info,$system,$login_device);
|
||||||
if($login['code'] != 1){
|
if($login['code'] != 1){
|
||||||
return $login;
|
return $login;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ class UserData extends Model
|
|||||||
db::startTrans();
|
db::startTrans();
|
||||||
//修改实名手机号
|
//修改实名手机号
|
||||||
$red = db::name('user_auth')->where(['id' => $is_real['id']])->update(['mobile' => $new_mobile]);
|
$red = db::name('user_auth')->where(['id' => $is_real['id']])->update(['mobile' => $new_mobile]);
|
||||||
$reslut = db::name('user')->where(['id' => $user_id])->update(['username' => $new_mobile]);
|
$reslut = db::name('user')->where(['id' => $user_id])->update(['username' => $new_mobile,'mobile' => $new_mobile]);
|
||||||
if ($reslut && $red) {
|
if ($reslut && $red) {
|
||||||
Db::commit();
|
Db::commit();
|
||||||
return ['code' => 1, 'msg' => '修改成功','data' =>null];
|
return ['code' => 1, 'msg' => '修改成功','data' =>null];
|
||||||
@@ -269,7 +269,7 @@ class UserData extends Model
|
|||||||
return ['code' => 0, 'msg' => '修改失败','data' =>null];
|
return ['code' => 0, 'msg' => '修改失败','data' =>null];
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
$reslut = db::name('user')->where(['id' => $user_id])->update(['username' => $new_mobile]);
|
$reslut = db::name('user')->where(['id' => $user_id])->update(['username' => $new_mobile,'mobile' => $new_mobile]);
|
||||||
if ($reslut) {
|
if ($reslut) {
|
||||||
return ['code' => 1, 'msg' => '修改成功','data' =>null];
|
return ['code' => 1, 'msg' => '修改成功','data' =>null];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user