作者 董瑞恩
1 个管道 的构建 通过 耗费 0 秒

interface

@@ -67,7 +67,9 @@ class LoginController extends HomeBaseController{ @@ -67,7 +67,9 @@ class LoginController extends HomeBaseController{
67 * @param name:encrypted_data type:String require:1 default:无 other: desc:encrypted_data 67 * @param name:encrypted_data type:String require:1 default:无 other: desc:encrypted_data
68 * @param name:iv type:String require:1 default:无 other: desc:iv 68 * @param name:iv type:String require:1 default:无 other: desc:iv
69 * 69 *
70 - * @return result:退款接口返回值 70 + * @return users_id:用户id
  71 + * @return type:是否注册(0、未注册,1、已注册)
  72 + * @return is_use:是否在使用设备(0:空闲,1:在用)
71 */ 73 */
72 public function getPhone(){ 74 public function getPhone(){
73 $param = $this->request->param(); 75 $param = $this->request->param();
@@ -85,14 +87,14 @@ class LoginController extends HomeBaseController{ @@ -85,14 +87,14 @@ class LoginController extends HomeBaseController{
85 if ($errCode != 0) { 87 if ($errCode != 0) {
86 $this->apiResponse(301,'操作失败'); 88 $this->apiResponse(301,'操作失败');
87 } 89 }
88 - $phone=""; 90 + $phone=$wxUserData['phoneNumber'];
  91 + $users=Db::name('users')->where('open_id',$openid)->find();
89 try{ 92 try{
90 - Db::name('users')->where('open_id',$openid)->update([]); 93 + Db::name('users')->where('open_id',$openid)->update(['phone'=>$phone]);
91 }catch (\Exception $exception){ 94 }catch (\Exception $exception){
92 95
93 } 96 }
94 - $this->apiResponse(200,'success',$wxUserData);  
95 - 97 + $this->apiResponse(200,'success',['users_id'=>$users['id'],'type'=>1,'is_use'=>$users['is_use']]);
96 } 98 }
97 99
98 100