예제 #1
0
파일: tag.php 프로젝트: JBZoo/Zoo-Changelog
 public function count($application_id = 0, $search = "")
 {
     // get database
     $db = $this->database;
     $select = 'DISTINCT a.name';
     $from = $this->name . " AS a, " . ZOO_TABLE_ITEM . " AS b USE INDEX (ID_APPLICATION_INDEX)";
     $conditions = array("a.item_id = b.id AND b.application_id = " . (int) $application_id . (!empty($search) ? " AND LOWER(a.name) LIKE " . $db->Quote('%' . $db->escape($search, true) . '%', false) : ""));
     $options = compact('select', 'from', 'conditions');
     return parent::count($options);
 }