SQLでナビゲーションメニューを取得する方法を知っている人はいますか?
これが必要なのは、2 つのサイト (果樹園と mvc サイト) があり、同じヘッダーとフッターのナビゲーションを使用したいからです。
選択を実行しましたが、結果はオーチャード cms サイトに表示されない行を取得しています。
SELECT M.MenuText, M.MenuPosition, R.DisplayAlias FROM Navigation_MenuPartRecord M
INNER JOIN Navigation_ContentMenuItemPartRecord N ON N.Id = M.Id
INNER JOIN Orchard_Framework_ContentItemVersionRecord C ON C.ContentItemRecord_id = N.ContentMenuItemRecord_id
INNER JOIN Orchard_Autoroute_AutoroutePartRecord R ON R.ContentItemRecord_id = N.ContentMenuItemRecord_id
WHERE M.MenuId = @MenuId
AND R.Id in
(
-- Get the last route part record modified
SELECT TOP 1 Id
FROM Orchard_Autoroute_AutoroutePartRecord
WHERE ContentItemRecord_id = N.ContentMenuItemRecord_id
ORDER BY Id DESC
)
AND C.Published = 1 AND C.Latest = 1
ありがとう!