Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE PROCEDURE [dbo].[block_catalogMenu2_get]
- @code nvarchar(128),
- @itemID nvarchar(256),
- @parameters ExtendedDictionaryParameter readonly, -- langID, username...
- @res nvarchar(MAX) output
- AS
- BEGIN
- DECLARE @s nvarchar(MAX) = '', @t nvarchar(MAX), @temp nvarchar(MAX)
- SET @t = '<ul class="list-unstyled position-relative">'
- SELECT @temp = STUFF(
- (
- SELECT '
- <li class="cat-menu-item border-bottom">
- <div class="cat-menu-item-label position-relative p-2 bg-white">
- <a href="#" class="text-dark" data-url="'+dbo.cat_getCatURL(cat1.id)+'"><i class="'+isnull('fa ' + icon, 'fas fa-mobile-alt')+'"></i> '+name+'</a>
- </div>
- <div class="cat-menu-item-content shadow-sm bg-white">
- <div class="d-flex flex-wrap flex-md-nowrap">
- <ul class="list-unstyled cat-menu-groups p-2">
- '+
- (
- STUFF(
- (
- SELECT '
- <li class="cat-menu-group">
- <header class="font-weight-bold">
- <a href="'+dbo.cat_getCatURL(cat2.id)+'" class="text-dark text-decoration-none small">'+name+'
- <span class="ml-1 text-muted ">('+
- CAST((SELECT COUNT (*) FROM as_cat_products p
- INNER JOIN as_cat_categoryProducts cp ON p.id = cp.productID
- WHERE categoryID = cat2.id) AS nvarchar) +
- ')</span>
- <img class="d-block mb-2 cat-menu-img" data-src="' +
- dbo.as_cat_getImageDomain(cat2.id)+
- isnull(dbo.rs_resourceLink('catSmallImage', cat2.id,1), '/uploads/marketplace/catDefault.jpg')+
- '" />
- </a>
- </header>
- </li>
- '
- FROM as_cat_categories cat2 WHERE parentID =cat1.id
- FOR XML PATH(''), TYPE
- ).VALUE('.','varchar(max)')
- ,1,0, '' )
- )
- + '
- </ul>
- <div class="cat-menu-additionalContent d-flex flex-wrap align-content-start p-2">
- <a href="/payment" class="m-1 text-center flex-grow-1">Оплата</a>
- <a href="/delivery" class="m-1 text-center flex-grow-1">Доставка</a>
- <a href="/return" class="m-1 text-center flex-grow-1">Возврат</a>
- <a href="/service" class="m-1 text-center flex-grow-1">Сервис</a>
- </div>
- </div>
- </div>
- </li>
- '
- FROM as_cat_categories cat1 WHERE parentID IS NULL
- FOR XML PATH(''), TYPE
- ).VALUE('.','varchar(max)')
- ,1,0, ''
- )
- SET @t = @t + @temp
- SET @t = @t + '</ul>
- '
- SET @res = '
- <div class="cat-menu-cont hide">
- <div class="cat-menu-dropdown position-relative d-inline-block">
- <a href="#" class="btn-sm mx-2 btn btn-light d-inline-block cat-menu-dropdown-toggle"><i class="fas fa-bars"></i></a>
- <div class="cat-menu shadow-sm mt-1">
- <header class="p-2 bg-light font-weight-bold"><i class="fas fa-list"></i> Категории</header>'
- SET @res = @res +@t
- SET @res = @res + '
- </div>
- </div>
- </div>
- '
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement