Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE PROCEDURE [dbo].[fm_watch_textru2_saveItem]
- @username nvarchar(256),
- @itemID int,
- @parameters ExtendedDictionaryParameter readonly
- AS
- BEGIN
- declare @uid nvarchar(128)= (select value2 from @parameters where [key] = 'uid')
- declare @result nvarchar(max) = ''
- select @result = json_result from textru_responses
- where uid = @uid
- declare @msg nvarchar(max) = '', @type nvarchar(128) = 'success'
- if(len(@result)>0 and ISJSON( @result )=1) begin
- print @result
- set @msg = '<h2 class=" text-white">Уникальность текста: ' + isnull(JSON_VALUE(@result,'$.unique'), '--') + '%</h2>'
- declare @p1 ExtendedDictionaryParameter
- insert into @p1 (Value2)
- select '<span class="font-weight-bold">'+ JSON_VALUE(value,'$.plagiat') + '%</span> - <a href="'+JSON_VALUE(value,'$.url')+'" target="_blank">' + JSON_VALUE(value,'$.url') + '</a>' Value2
- from OPENJSON(@result,'$.urls')
- declare @plagiat nvarchar(max) = isnull( dbo.as_agg(@p1, '<br>'), '')
- if(len(@plagiat)>0) begin
- set @msg = @msg + '<h5 class="mt-2 mb-1 text-white">C каких сайтов плагиат (url и % плагиата)</h5>' + @plagiat
- end
- end else begin
- set @type = 'warning'
- set @msg = 'Пока нет результата, попробуйте нажать кнопку через 20-30 сек.'
- end
- -- 1 SELECT (Result, Msg)
- select 1 Result, @msg Msg, 1 EnableSaveAlert, @type type, 100000 delay
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement