Advertisement
Ruslan_Rayanov

falcon_search - поиск по базе знаний

Jul 1st, 2022
1,523
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.90 KB | None | 0 0
  1. -- добавить в falcon_search
  2.    if(@typeID=100) begin
  3.       -- поиск чисто по базе знаний
  4.  
  5.         insert into #result
  6.        select top 20 id,
  7.               '<a href="#" class="as-form-modal"  data-code="knowledgeBaseArticle" data-slideout="1" data-itemID="'+try_cast(id as nvarchar)+'" data-big="1" data-title="'+isnull(title,'')+'"><i class="fab fa-leanpub"></i> '+title+'</a>',
  8.               'Обновил: ' + updatedBy + ' ' + convert(nvarchar,isnull(updated,'2020-01-01'),104) + ' ' + LEFT(convert(nvarchar, isnull(updated,'2020-01-01'),108),5),
  9.               '',
  10.               getdate()
  11.        from kb_articles
  12.        where (appCode is null or appCode='')
  13.             and (title like '%'+@q+'%' or text like '%'+@q+'%' )
  14.        order by charindex(lower(@q), lower(title)) desc
  15.        
  16.        select * from #result
  17.         drop table #result        
  18.         return
  19.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement