<?php
/**
 * [LJCMS] (C)2012-2099 LJdev,Inc.
 * <E-Mail：aspcms@qq.com>
 * Url http://www.liangjing.org
 *     http://www.8CMS.com
 * Update 2013.11.19
*/

class notifyAModel extends X {
    
    public function getList($items) {
        $where      = " WHERE 1=1".$items['searchsql'];
        $start      = ($items['page']-1)*$items['pagesize'];
        $countsql   = "SELECT COUNT(v.adminid) FROM ".DB_PREFIX."notify AS v".$where;
        $total      = parent::$obj->fetch_count($countsql);
        $sql        = "SELECT v.*,g.groupname".
                      " FROM ".DB_PREFIX."notify AS v".
                      " LEFT JOIN ".DB_PREFIX."authgroup AS g ON v.groupid=g.groupid".
                      $where." ORDER BY v.adminid DESC LIMIT ".$start.", ".$items['pagesize']."";

        $array = parent::$obj->getall($sql);
      
        return array($total, $array);
    }
       public function doDel($id) {
        $sql = "DELETE FROM ".DB_PREFIX."notify WHERE adminid='".intval($id)."'";
        return parent::$obj->query($sql);
    }
}
?>
