<?php 
class Auth_Login_Model extends Model{
	function __construct(){
		parent::__construct();
		$this->db	=	new Database();
	}
	//检查用户密码
	function checkLogin($user,$login_type=''){
		if(empty($login_type)){$login_type='user_name';}
		$sql='SELECT u.user_name,u.user_id,u.user_status,ug.group_name,ug.group_value,ug.group_id FROM '.DBFIX.'user as u 
		JOIN '.DBFIX.'user_group as ug ON ug.group_id=u.user_role 
		WHERE u.'.$login_type.'=\''.$user['user_name']. '\' AND user_pwd=\''.$user['user_pwd'].'\'';
		return $this->db->query($sql);
	}
}