%%%-------------------------------------------------------------------
%%% author : ljy
%%% desc   : 国战-光辉岁月数据修复
%%% Time   : 2021.04.25
%%%-------------------------------------------------------------------
-module(fix_cross_guild_war).
-author("ljy").

%% API
-export([recover_cgw_log/2]).

-include("cross_guild_war.hrl").

recover_cgw_log(ZoneId, Time) ->
    % 数据库清理缺失的数据
    Sql = io_lib:format("delete from `log_cgwar_city_info` where `zone_id` = ~p", [ZoneId]),
    db:execute(Sql),
    % 删除ets表旧数据
    ets:delete_all_objects(?CGW_CITY_LOG_ETS),
    % 重新加载ets表数据
    cross_guild_war_mgr:cast({recover_cgw_log, Time}).