<?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 deptGradeOModel extends X {


  
        public function get_top_menu_data($id){
	        $sql = "SELECT * FROM ".DB_PREFIXOA."dept_grade WHERE id='".$id."'";
                return parent::$obj->fetch_first($sql);
	}



        public function get_DeptGrade_list(){
             $sql=' SELECT `id`,`name`,`is_del` FROM `oa_dept_grade` WHERE ( is_del=0 ) ORDER BY sort asc';
             $list = parent::$obj->getall($sql);
             return $list;
        }

                public function doEdit($id,$arr){
                unset($arr['id']);
                unset($arr['opmode']);
                unset($arr['ajax']);        
                $result = parent::$obj->update(DB_PREFIXOA.'dept_grade', $arr, 'id='.$id.'');
                return $result;
        }  
        public function doAdd($array) {
         
              unset($array['ajax']);
             unset($array['opmode']);
 
           return parent::$obj->insert(DB_PREFIXOA.'dept_grade', $array); 
      }
      public function del($id){
        $sql = "DELETE FROM ".DB_PREFIXOA."dept_grade WHERE id='".intval($id)."'";
        return parent::$obj->query($sql);
      }
        
}
?>
