MySQL递归查询所有子节点
select id from ( select t1.id, if(find_in_set(parent_id, @pids) > 0, @pids := concat(@pids, ',', id), 0) as ischild from ( select id,parent_id from menu t where t.status = 1 order by parent_id, id ) t1, (select @pids := 要查询的菜单节点 id) t2 ) t3 where ischild != 0