Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE PROCEDURE [dbo].[list_projects_getItem]
- @itemID int,
- @username nvarchar(32),
- @parameters DictionaryParameter READONLY
- AS
- BEGIN
- declare @langID int
- select @langID = try_cast(value as int) from @parameters where [key] = 'langID'
- if isnull(@langID,0)=0 set @langID = 2
- select port.id,
- isnull(lang.title,port.title) as name,
- 0 price,
- iif(isnull(lang.task, port.task)<>'', '<h2>'+iif(@langID=1, 'Initial task', 'Начальная задача')+'</h2>'+ isnull(lang.task, port.task), '') +
- iif(isnull(lang.solution, port.solution)<>'', '<h2>'+iif(@langID=1, 'Solution', 'Решение')+'</h2>'+ isnull(lang.solution, port.solution), '') +
- iif(isnull(lang.answers, port.answers)<>'', '<h2>'+iif(@langID=1, 'Customer response', 'Отклик заказчика')+'</h2>'+ isnull(lang.answers, port.answers), '') [desc],
- '' List1Makeup,
- '<h3>{p1}</h3><div class="mb-3">{p2}</div>' List2Makeup,
- '' List3Makeup,
- '' List4Makeup,
- '' List5Makeup,
- isnull(lang.title,port.title) + ' - FALCON' + iif(@langID=1, ' Project', ' Проект') SeoTitle,
- dbo.[as_stripHTML](isnull(lang.task,port.task)) + ' - FALCON' + iif(@langID=1, ' Project', ' Проект') SeoDescription,
- dbo.[as_stripHTML](isnull(lang.task,port.task)) + ' - FALCON' + iif(@langID=1, ' Project', ' Проект') SeoKeywords,
- iif(@langID=1, 'Falcon Space Projects', 'Проекты Falcon Space') BreadcrumbRootTitle
- from as_falconPortfolio port
- left join as_lang_portfolio lang on lang.portfolioID = port.id and lang.langID = @langID
- where port.id = @itemID
- -- Определяем цепочку категорий
- declare @level int
- CREATE TABLE dbo.#cats (id int, code nvarchar(256), title nvarchar(256))
- insert into #cats
- select id, code, title
- from as_falconPortfolioCategories
- where id = (select catID from as_falconPortfolioItemCategories where itemID = @itemID)
- -- SELECT 2 Cats chain
- select * from #cats
- drop table #cats
- --SELECT 3 ItemParams - Атрибуты (Структура ID, Name, Code, Value, ItemID)
- select 2 as ID, 'Картинка' as Name, 'image' as Code, dbo.rs_resourceLink('falconPortfolio',try_cast(id as nvarchar),0) as value, id as ItemID from as_falconPortfolio where id = @itemID
- union
- select 3 as ID, 'Ссылка' as Name, 'projectUrl' as Code, iif(isnull(url,'')<>'', '<a href="'+url+'" class="btn btn-outline-primary btn-sm ml-2 mb-2" target="_blank"><i class="fa fa-link"></i> '+url+'</a>', '') as value, id as ItemID from as_falconPortfolio where id = @itemID
- union
- select 3 as ID, 'Айди' as Name, 'itemID' as Code, try_cast(id as nvarchar) as value, id as ItemID from as_falconPortfolio where id = @itemID
- union
- select 3 as ID, 'cta' as Name, 'cta' as Code, dbo.as_htmlBlockLang('cta',@langID) as value, 0 as ItemID
- --select 1 as ID, 'Фото' as Name, 'photo1' as Code, '<div class="as-resourceManager" data-code="listItemImagetest" data-itemID="'+(select isnull(username,'') from ctr_contacts where id = contactID)+'" data-hideTitle="1"></div>' as value, id as itemID from au_suppliers where id = @itemID
- --union
- --select 2 as ID, 'Оценка' as Name, 'mark' as Code,'12344' value, id as itemID from au_suppliers where id = @itemID
- -- SELECT 4-9
- -- Категории услуг и расценки
- --select '111' p1, '22' p2, '22' p3, '22' p4, '22' p5
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement