diff --git a/app/Http/Controllers/Api/UserController.php b/app/Http/Controllers/Api/UserController.php
index 6157a5d..6842058 100644
--- a/app/Http/Controllers/Api/UserController.php
+++ b/app/Http/Controllers/Api/UserController.php
@@ -134,7 +134,7 @@ class UserController extends CommonController
$data['password'] = $request->input('password','');
$data['openid'] = $request->input('openid','');
- if (($data['user_name']=='' && $data['password']=='') || $data['openid']=='')
+ if (($data['user_name']=='' || $data['password']=='') && $data['openid']=='')
{
return ReturnData::create(ReturnData::PARAMS_ERROR);
}
diff --git a/app/Http/Controllers/Weixin/UserController.php b/app/Http/Controllers/Weixin/UserController.php
index 46072b3..2024182 100644
--- a/app/Http/Controllers/Weixin/UserController.php
+++ b/app/Http/Controllers/Weixin/UserController.php
@@ -323,7 +323,7 @@ class UserController extends CommonController
$res = curl_request($url,$postdata,'POST');
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 451c316..9457459 100644
--- a/app/Http/Model/User.php
+++ b/app/Http/Model/User.php
@@ -199,9 +199,16 @@ class User extends BaseModel
{
extract($param); //参数
- $user = self::where(array('mobile'=>$user_name,'password'=>$password))->orWhere(array('user_name'=>$user_name,'password'=>$password))->orWhere(array('openid'=>$openid))->first();
+ if(isset($openid))
+ {
+ $user = self::where(array('openid'=>$openid))->first();
+ }
+ else
+ {
+ $user = self::where(array('mobile'=>$user_name,'password'=>$password))->orWhere(array('user_name'=>$user_name,'password'=>$password))->first();
+ }
- if(!$user){return false;}
+ if(!isset($user)){return false;}
$res = self::getUserInfo($user->id);
$token = Token::getToken(Token::TYPE_WEIXIN, $user->id);
diff --git a/resources/views/weixin/common/footer.blade.php b/resources/views/weixin/common/footer.blade.php
index 1bc2fc2..ad9b862 100644
--- a/resources/views/weixin/common/footer.blade.php
+++ b/resources/views/weixin/common/footer.blade.php
@@ -5,7 +5,7 @@
current(); ?>
>首页
分类
- 购物车
+ 购物车
>个人中心