<?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 countAModel extends X {
    
    public function getCount($type) {
        $sql = "SELECT COUNT(*) AS my_count";
        if ($type == 'article') {
            $sql .= " FROM ".DB_PREFIX."article";
        }
        elseif ($type == 'product') {
            $sql .= " FROM ".DB_PREFIX."product";
        }
        elseif ($type == 'photo') {
            $sql .= " FROM ".DB_PREFIX."photo";
        }
        elseif ($type == 'download') {
            $sql .= " FROM ".DB_PREFIX."download";
        }
        elseif ($type == 'hr') {
            $sql .= " FROM ".DB_PREFIX."hr";
        }
        elseif ($type == 'about') {
            $sql .= " FROM ".DB_PREFIX."about";
        }
        $count = parent::$obj->fetch_count($sql);
        return $count;
    }
}
?>
