You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
630 B
22 lines
630 B
CREATE DEFINER=`root`@`%` FUNCTION `isfiltered`(field varchar(255)) RETURNS tinyint
|
|
BEGIN
|
|
set @keywords = "";
|
|
set @word = "";
|
|
SELECT trim(value) into @keywords FROM guoyan.sysconfigure where fieldname = 'PresaleKeyword';
|
|
set @keywords = replace(replace(@keywords, ' ', ''), ',', ',');
|
|
set @keywords = concat(@keywords, ',');
|
|
|
|
while length(@keywords) > 0 do
|
|
select SUBSTRING_INDEX(@keywords, ',', 1) into @word;
|
|
|
|
if findbykeyword(field, @word) then
|
|
return true;
|
|
end if;
|
|
|
|
set @keywords = replace(@keywords, concat(@word, ','), '');
|
|
|
|
end while;
|
|
|
|
return false;
|
|
|
|
END
|
|
|