Код: Выделить всё
public function _search($type, $qes, $sort = null, $start = 0)
{
$this->db
->select('id,name,frontCover,type,category,user,author,MRP,sellingPrice,isNew,isRaw,binding,publisherName,publicationYear')
->from('books');
$searchKey = "";
if (is_array($qes) && count($qes) > 0) {
$searchKey = "+" . implode(" +", $qes);
}
//full text search
$searchKey = "MATCH name AGAINST ('" . $searchKey . "')";
$this->db->where("(" . $searchKey . ")", NULL, FALSE);
$this->db->where('status', 1)->limit(30, $start);
$query = $this->db->get();
return $query && $query->num_rows() ? $query->result() : [];
}
Подробнее здесь: https://stackoverflow.com/questions/510 ... odeigniter