...
|
...
|
@@ -75,7 +75,7 @@ class Login extends Base |
|
|
|
|
|
//直接通过unionid 查找用户信息
|
|
|
$userres = Db::name("user")->where("wx_xcx_openid", $openid)->order("id desc")->find();
|
|
|
|
|
|
print_r($userres);return;
|
|
|
if (empty($userres)) {
|
|
|
//如果通过小程序openid找不到会员
|
|
|
//注册处理
|
...
|
...
|
@@ -125,13 +125,6 @@ class Login extends Base |
|
|
if (empty($userres['mobile']) && !empty($openid_info['phoneNumber'])) {
|
|
|
$update_data['mobile'] = $openid_info['phoneNumber'];
|
|
|
}
|
|
|
// if (!empty($openid_info['phoneNumber'])) {
|
|
|
// $update_data['username'] = $openid_info['phoneNumber'];
|
|
|
// }
|
|
|
// if (!empty($openid_info['nickName']) && $openid_info['nickName']!="微信用户") {
|
|
|
// $update_data['nickname'] = $openid_info['nickName'];
|
|
|
// }
|
|
|
|
|
|
|
|
|
if (!empty($openid_info['phoneNumber'])) {
|
|
|
//这里是已注册过的用户,有手机号,需要判断下手机号有没有在区域管理员中存在,若存在就将id绑定过去
|
...
|
...
|
@@ -144,23 +137,9 @@ class Login extends Base |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
Db::name("user")->where("wx_xcx_openid", $openid)->update($update_data);
|
|
|
$this->auth->direct($userres['id']);
|
|
|
$return_data = $this->auth->getUserinfo();
|
|
|
|
|
|
$is_mng_user = 0;//是否是部门管理员 0不是 1是
|
|
|
$mng_area = [];//管辖部门(多个)
|
|
|
$area = Db::name("hc_area_code_mng")->alias("a")
|
|
|
->join("hc_area_code b", "b.code=a.mng_code")
|
|
|
->where("a.mng_user_id", $return_data['id'])->field("b.code,b.name")->select();
|
|
|
if (!empty($area)) {
|
|
|
$is_mng_user = 1;
|
|
|
$mng_area = $area;
|
|
|
}
|
|
|
$return_data['is_mng_user'] = $is_mng_user;
|
|
|
$return_data['mng_area'] = $mng_area;
|
|
|
|
|
|
$this->success(__('登录成功'), $return_data);
|
|
|
}
|
|
|
}
|
...
|
...
|
|