我在下面查询它的条件(减去选择、来自等)
$this->db->where('show_year', $yyyy);
$this->db->or_where('idn', $idn);
$this->db->or_like('post_slug', $idn);
哪些形式
SELECT * FROM (`nyb_articles`)
WHERE `show_year` = '2009'
OR `idn` = 'the'
AND `post_slug` LIKE '%the%'
但是我希望它更像
SELECT * FROM (`nyb_articles`)
WHERE `show_year` = '2009'
AND (`idn` = 'the' OR `post_slug` LIKE '%the%')
我的问题是我不确定 CI 的活动记录是否支持这个概念,如果支持,我将如何解决它,因为我在文档的任何地方都找不到它的概念。无论我如何改变like
, or_like
, where
,or_where
我什至无法确定类似的东西。所以有人有任何想法吗?如果可能的话,我宁愿远离原始查询,但如果我必须准备一个并这样做,我会,只是不想这样做。