业务需求:获取根据当前条件查找的文章的上一篇和下一篇文章
SELECT IFNULL((select id from sys_dynamic where id < 7 order by id desc limit 1),-1) union all SELECT IFNULL((select id from sys_dynamic where id > 7 order by id asc limit 1),-1);
直接复制sql即可。如果没有上篇或下篇返回-1
业务需求:获取根据当前条件查找的文章的上一篇和下一篇文章
SELECT IFNULL((select id from sys_dynamic where id < 7 order by id desc limit 1),-1) union all SELECT IFNULL((select id from sys_dynamic where id > 7 order by id asc limit 1),-1);
直接复制sql即可。如果没有上篇或下篇返回-1