From 78d28948e0aa9d130af7559b75c7c57f45665de6 Mon Sep 17 00:00:00 2001 From: "ZLW-PC\\Administrator" <374861669@qq.com> Date: Mon, 6 Nov 2017 17:31:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=B3=A8=E5=86=8Cbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Weixin/UserController.php | 4 ++-- app/Http/Model/User.php | 10 +++++----- resources/views/weixin/user/login.blade.php | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/Weixin/UserController.php b/app/Http/Controllers/Weixin/UserController.php index c5341c9..46072b3 100644 --- a/app/Http/Controllers/Weixin/UserController.php +++ b/app/Http/Controllers/Weixin/UserController.php @@ -321,9 +321,9 @@ class UserController extends CommonController ); $url = env('APP_API_URL')."/wx_oauth_register"; $res = curl_request($url,$postdata,'POST'); - dd($postdata); - if($res['code'] != ReturnCode::SUCCESS_CODE){$this->error_jump('系统错误');} + if($res['code'] != ReturnCode::SUCCESS_CODE){$this->error_jump('系统错误');} + dd($res); $_SESSION['weixin_user_info'] = $res['data']; header('Location: '.route('weixin_user'));exit; diff --git a/app/Http/Model/User.php b/app/Http/Model/User.php index 0fa7081..451c316 100644 --- a/app/Http/Model/User.php +++ b/app/Http/Model/User.php @@ -179,11 +179,11 @@ class User extends BaseModel if(isset($user_name)){$data['user_name'] = $user_name;} if(isset($mobile)){$data['mobile'] = $mobile;} if(isset($password)){$data['password'] = $password;} //md5加密 - if(isset($parent_id)){$data['parent_id'] = $parent_id;} - if(isset($openid)){$data['openid'] = $openid} - if(isset($sex)){$data['sex'] = $sex} - if(isset($head_img)){$data['head_img'] = $head_img} - if(isset($nickname)){$data['nickname'] = $nickname} + if(isset($parent_id) && !empty($parent_id)){$data['parent_id'] = $parent_id;} + if(isset($openid)){$data['openid'] = $openid;} + if(isset($sex)){$data['sex'] = $sex;} + if(isset($head_img)){$data['head_img'] = $head_img;} + if(isset($nickname)){$data['nickname'] = $nickname;} if (isset($data) && $id = self::add($data)) { diff --git a/resources/views/weixin/user/login.blade.php b/resources/views/weixin/user/login.blade.php index b49aecd..fef72d9 100644 --- a/resources/views/weixin/user/login.blade.php +++ b/resources/views/weixin/user/login.blade.php @@ -39,7 +39,7 @@ 登录