Пример #1
0
 public function getCount($where)
 {
     $db = $this->_tdb->getAdapter();
     $select = $db->select();
     if (in_array('isdelete', $this->_tdb->_cols) && !isset($where['isdelete'])) {
         $where['isdelete'] = 0;
     }
     $select->from($this->_tdb->name, 'count(*) as count');
     Common_Db_Util::buildSelectWhere($select, $where);
     $select->order($order);
     $select->limit($limit, $offset);
     try {
         $rs = $db->fetchRow($select);
     } catch (Exception $e) {
         throw $e;
     }
     return (int) $rs['count'];
 }
Пример #2
0
 public function getCount($where)
 {
     $db = $this->getAdapter();
     $select = $db->select();
     $cols = $this->_getCols();
     if (in_array('deleted', $cols) && !isset($where['deleted'])) {
         $where['deleted'] = 0;
     }
     $select->from($this->_name, 'count(*) as count');
     Common_Db_Util::buildSelectWhere($select, $where);
     try {
         $rs = $db->fetchRow($select);
     } catch (Exception $e) {
         throw $e;
     }
     return (int) $rs['count'];
 }