【发布时间】:2019-10-07 15:52:30
【问题描述】:
我有一些这样的搜索模型,
public function get_products_by_keyword($keyword) {
$this->db->select('*');
$this->db->from('item');
$this->db->like('item_name',$keyword);
$this->db->where('item_product_type', 'watches');
return $this->db->get()->result();
}
item_product_type 列表:手表、建筑、aksesoris、眼镜、促销
在数据库中,我有 5 个item_product_type,但我只想显示 3 个类别,如何在 CodeIgniter 中做到这一点?
【问题讨论】:
标签: php codeigniter search