作者 郭文星

123

@@ -75,7 +75,7 @@ class Login extends Base @@ -75,7 +75,7 @@ class Login extends Base
75 75
76 //直接通过unionid 查找用户信息 76 //直接通过unionid 查找用户信息
77 $userres = Db::name("user")->where("wx_xcx_openid", $openid)->order("id desc")->find(); 77 $userres = Db::name("user")->where("wx_xcx_openid", $openid)->order("id desc")->find();
78 - 78 + print_r($userres);return;
79 if (empty($userres)) { 79 if (empty($userres)) {
80 //如果通过小程序openid找不到会员 80 //如果通过小程序openid找不到会员
81 //注册处理 81 //注册处理
@@ -125,13 +125,6 @@ class Login extends Base @@ -125,13 +125,6 @@ class Login extends Base
125 if (empty($userres['mobile']) && !empty($openid_info['phoneNumber'])) { 125 if (empty($userres['mobile']) && !empty($openid_info['phoneNumber'])) {
126 $update_data['mobile'] = $openid_info['phoneNumber']; 126 $update_data['mobile'] = $openid_info['phoneNumber'];
127 } 127 }
128 -// if (!empty($openid_info['phoneNumber'])) {  
129 -// $update_data['username'] = $openid_info['phoneNumber'];  
130 -// }  
131 -// if (!empty($openid_info['nickName']) && $openid_info['nickName']!="微信用户") {  
132 -// $update_data['nickname'] = $openid_info['nickName'];  
133 -// }  
134 -  
135 128
136 if (!empty($openid_info['phoneNumber'])) { 129 if (!empty($openid_info['phoneNumber'])) {
137 //这里是已注册过的用户,有手机号,需要判断下手机号有没有在区域管理员中存在,若存在就将id绑定过去 130 //这里是已注册过的用户,有手机号,需要判断下手机号有没有在区域管理员中存在,若存在就将id绑定过去
@@ -144,23 +137,9 @@ class Login extends Base @@ -144,23 +137,9 @@ class Login extends Base
144 } 137 }
145 } 138 }
146 } 139 }
147 -  
148 Db::name("user")->where("wx_xcx_openid", $openid)->update($update_data); 140 Db::name("user")->where("wx_xcx_openid", $openid)->update($update_data);
149 $this->auth->direct($userres['id']); 141 $this->auth->direct($userres['id']);
150 $return_data = $this->auth->getUserinfo(); 142 $return_data = $this->auth->getUserinfo();
151 -  
152 - $is_mng_user = 0;//是否是部门管理员 0不是 1是  
153 - $mng_area = [];//管辖部门(多个)  
154 - $area = Db::name("hc_area_code_mng")->alias("a")  
155 - ->join("hc_area_code b", "b.code=a.mng_code")  
156 - ->where("a.mng_user_id", $return_data['id'])->field("b.code,b.name")->select();  
157 - if (!empty($area)) {  
158 - $is_mng_user = 1;  
159 - $mng_area = $area;  
160 - }  
161 - $return_data['is_mng_user'] = $is_mng_user;  
162 - $return_data['mng_area'] = $mng_area;  
163 -  
164 $this->success(__('登录成功'), $return_data); 143 $this->success(__('登录成功'), $return_data);
165 } 144 }
166 } 145 }