-----------------------------------------------
-- 公会相关排行榜

-- 排序规则
-- 公会：总战力 等级
-----------------------------------------------

local LuaMongo = _G.lua_mongo
local DB = require("common.DB")
local BillboardDefine = require("billboard.BillboardDefine")
local BillboardDB = require("billboard.BillboardDB")
local BRoleLogic = require("billboard.BRoleLogic")


-- 公会战力排行榜
function loadUnionBoard()
    -- 公会
    local cnt = 0
	LuaMongo.find(DB.db_union, nil, BillboardDB.unionFields)	
    while true do
        local data = {}
        if not LuaMongo.next(data) then
        	break
        end

        cnt = cnt + 1
        if cnt % 1000 == 0 then
			_G.collectgarbage("step", 100000)
		end

		BRoleLogic.updateData(BillboardDefine.TYPE_UNION, data, true)      -- 公会战斗力
    end
end





