мНет описания правки
Метка: ручная отмена
мНет описания правки
 
(не показана 1 промежуточная версия этого же участника)
Строка 2: Строка 2:


function p.main(frame)
function p.main(frame)
local result = frame:preprocess([[{{#cargo_query:tables=Persona |fields=COUNT(*)=Count |where=Persona.Image IS NOT NULL AND Persona.Image<>''}}]])    local count = tonumber(result:match("%d+"))
local result = frame:preprocess([[{{#cargo_query:tables=Persona |fields=COUNT(*)=Count |where=Persona.Image IS NOT NULL AND Persona.Image<>''}}]])     
local count = tonumber(string.match(result, "%d+"))
     return count
     return count
end
end


return p
return p

Текущая версия от 16:23, 28 сентября 2023

Вычисление количества персоналий с фотографиями.


Вызов функции:

{{#invoke:CountPerson|main}}

Значение функции:

1


local p = {}

function p.main(frame)
local result = frame:preprocess([[{{#cargo_query:tables=Persona |fields=COUNT(*)=Count |where=Persona.Image IS NOT NULL AND Persona.Image<>''}}]])    
local count = tonumber(string.match(result, "%d+"))
    return count
end

return p