这里是一个where子句我有:雄辩的Where子句中的类似于通配符的语法?
->where('post_type', '=', 'blog')
有没有办法通过一个通配符来代替“博客”,所以它会匹配任何“post_type”?
全面查询:
$db = (new DbSql())->db()->getConnection();
$postsCount = $db->table('posts')
->where('status', '=', 'published')
->where('post_type', '=', 'blog')
->where('alerts', '<', Settings::CONTENT_ALERT_NUMBER_ALLOWANCE)
->count() ?? null;
只需删除语句 –