我想把这个查询语句转换成分页的laravel查询生成器
"SELECT images.*,categories.name,categories.slug FROM ( SELECT 1 AS rnk, images.* FROM images WHERE title REGEXP '[[:<:]]{$q}[[:>:]]'
UNION SELECT 2 AS rnk, images.* FROM images WHERE tags REGEXP '[[:<:]]{$q}[[:>:]]' ) images
inner join categories on categories.id = images.categories_id
where status = 'active' ORDER BY rnk"
我用的是拉威尔5.3
1条答案
按热度按时间piztneat1#
完成;)