SELECt T2.id, T2.title,T2.controller,T2.method,T2.urlFROM ( SELECt @r AS _id, (SELECT @r := parent_id FROM menu WHERe id = _id) AS parent_id, @l := @l + 1 AS lvl FROM (SELECT @r := 31, @l := 0) vars, menu m WHERe @r <> 0) T1JOIN menu T2ON T1._id = T2.idORDER BY T1.lvl DESC;
演示版
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)