| 
					
				 | 
			
			
				@@ -90,6 +90,13 @@ class User extends Api 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if ($user->status != 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $this->error(__('Account is locked')); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            //如果客户openid为空需要绑定 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (!empty($openid) && empty($user['mini_openid'])) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $userRes = Db::name('user')->where('id',$user['id'])->update(['mini_openid'=>$openid]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (!$userRes) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $this->error('绑定微信失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //如果已经有账号则直接登录 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $ret = $this->auth->direct($user->id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } else { 
			 |