Модуль:Статистика

Материал из Кадровый состав НКВД 1935-1939
Версия от 15:33, 26 ноября 2016; StasR (обсуждение | вклад) (Новая страница: «local p = {} local tools = require( 'Module:Tools' ) function p.StatD( frame ) --[[ local docs = frame:callParserFunction{ name = '#cargo_query', args = { '',…»)
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)
Перейти к навигации Перейти к поиску

Для документации этого модуля может быть создана страница Модуль:Статистика/doc

local p = {}
local tools = require( 'Module:Tools' )

function p.StatD( frame )
--[[	
	local docs = frame:callParserFunction{ name = '#cargo_query', args = { '',
		tables = 'docs',
		fields = 'COUNT(_pageID) = docs',
--		limit = 10000,
		format = 'native',
		default = '',
		} }
	return mw.ext.cargo.get()[1].docs
--]]
	return tools.cq( 'docs', 'COUNT(_pageID)', {} )[1]['COUNT(_pageID)']
end

function p.StatP( frame )
--[[	
	local persons = frame:callParserFunction{ name = '#cargo_query', args = { '',
		tables = 'persons',
		fields = 'COUNT(_pageID) = persons',
--		limit = 10000,
		format = 'native',
		default = '',
		} }
	return  mw.ext.cargo.get()[1].persons
--]]
	return tools.cq( 'persons', 'COUNT(_pageID)',  {} )[1]['COUNT(_pageID)']
end

return p