<?php
/**
 * Copyright (C) LJCMS All rights reserved.
 * <E-Mail：aspcms@qq.com>
 * Url http://www.liangjing.org
 *     http://www.8CMS.com
 * Update 2016.03.19
 */

class loginOModel extends X {
        function check_login($map){ 
		$emp_no= $map['emp_no'];
		$is_del =$map['is_del'];
		$password=$map['password'];
		$sql = "SELECT * FROM ".DB_PREFIXOA."user WHERE emp_no='".$emp_no."' AND is_del='".$is_del."' AND password='".$password."'";
                $data= parent::$obj->fetch_first($sql);
                if(empty($data)){
                    $sql = "SELECT * FROM ".DB_PREFIXOA."user WHERE name='".$emp_no."' AND is_del='".$is_del."' AND password='".$password."'";
                    $data= parent::$obj->fetch_first($sql);
                }
		return $data;
       }
       public function save($id,$arr){
           return parent::$obj->update(DB_PREFIXOA.'user', $arr, 'id='.$id.'');
       }
            function get_system_config($code) {
                $sql = "SELECT * FROM ".DB_PREFIXOA."System_Config WHERE code='".$code."'";
                return parent::$obj->fetch_first($sql);
        }
}
?>
