예제 #1
0
 /**
  * 表统计
  *
  * @param array $filter
  * @return int
  */
 public function count(array $filter = array())
 {
     $sql = "SELECT COUNT(*) FROM " . $this->db->table($this->tableName);
     if (!empty($filter)) {
         $sql .= " WHERE " . $this->parseFilter($filter);
     }
     return intval($this->db->getOne($sql));
 }