|
@@ -103,12 +103,14 @@ class WorkBind extends Api{
|
|
|
if( empty($id) ) return json_send(['code'=>'error','msg'=>'用户不存在','data'=>['error'=>'用户ID有误']]);
|
|
|
// 通过手机号查询账号
|
|
|
$custom = $Model->getOne($uid);
|
|
|
+ // 用户不存在
|
|
|
+ if( empty($custom) ) return json_send(['code'=>'error','msg'=>'用户不存在','data'=>['error'=>'未查询到用户信息']]);
|
|
|
// 查询用户
|
|
|
$external = $WorkExternal->getOne($id);
|
|
|
// 用户不存在
|
|
|
if( empty($external) ) return json_send(['code'=>'error','msg'=>'用户不存在','data'=>['error'=>'用户不存在']]);
|
|
|
// 如果手机号已经存在
|
|
|
- if( $external['custom_uid'] ) return json_send(['code'=>'error','msg'=>'用户已绑定','data'=>['error'=>'用户已绑定']]);
|
|
|
+ if( $external['custom_uid'] ) return json_send(['code'=>'success','msg'=>'用户已绑定','data'=>['uid'=>$custom['uid']]]);
|
|
|
// 获取不包含区号的手机号(因为绑定手机号字段会有国际区号)
|
|
|
$phone = $custom['phone'];
|
|
|
// 新用户信息
|