function getList() { $db = oseDB::instance(); $where = array(); $search = JRequest::getString('search', null); if (isset($search) && $search != '') { $searchEscaped = $this->_db->Quote('%' . $this->_db->getEscaped($search, true) . '%', false); $where[] = ' subject LIKE ' . $searchEscaped; } $where = array_merge($where, oseJSON::generateQueryWhere()); // Generate the where query $where = count($where) ? ' WHERE (' . implode(') AND (', $where) . ')' : ''; $query = " SELECT id,subject,body,type, count(*) As total FROM `#__osemsc_email`" . $where; //$db->setQuery($query); $this->total = $this->_getListCount($query); //oseExit($query); $start = JRequest::getInt('start', 0); $limit = JRequest::getInt('limit', 20); $db->setQuery($query, $start, $limit); //oseExit($db->_sql); $rows = $db->loadAssocList(); //oseExit($rows); return $rows; }