%%-----------------------------------------------------------------------------
%% module  :       guild_labor
%% @author  :      zmh
%% Created :       20191207
%% description:    社团劳务
%%----------------------------------------------------------------------------

-define(SQL_GUILD_LABOR_GET,<<"SELECT tid,content,state,time from player_guild_labor WHERE rid = ~p">>).
-define(SQL_GUILD_LABOR_INSERT,<<"REPLACE INTO `player_guild_labor` (`rid`,`tid`,`content`,`state`,`time`) VALUES (~p, ~p, '~ts',~p,~p)">>).
-define(SQL_ROLE_GUILD_SHOP_GET,<<"SELECT `cargos_daily`,`time_daily`,`cargos_week`,`time_week`,`cargos_forever` FROM `role_guild_shop` WHERE rid = ~p">>).
-define(SQL_ROLE_GUILD_SHOP_INSERT,<<"REPLACE INTO `role_guild_shop` (`rid`,`cargos_daily`,`time_daily`,`cargos_week`,`time_week`,`cargos_forever`) VALUES (~p,'~ts',~p,'~ts',~p,'~ts')">>).


%%任务类型
-define(GTASK_TYPE_TASK,        1).  %%社团周任务
-define(GTASK_TYPE_ORDER,       2).  %%派单
-define(GTASK_TYPE_NOON,        3).  %%午间BOSS
-define(GTASK_TYPE_NIGHT,       4).  %%晚间BOSS
-define(GTASK_TYPE_COLLECT,     5).  %%封印间隙
-define(GTASK_TYPE_PARTY,       6).  %%社团晚宴

-define(GTASK_TYPE_GUILD_GOODS,   99).  %%道具获得 独占

-record(guild_task, {
    id = 0,
    content = 0,
    state = 0,
    time = 0
}).

-record(guild_task_base, {
    id = 0,
    type = 0,
    add = 0,
    days = [],
    content = {},
    awards = []
}).

-record(guild_labor_awards, {
    need = 0,
    awards = []
}).

%%社团商店
-record(role_guild_shop, {
    cargos_daily = [],   %%每日商品
    time_daily   = 0,    %%上次刷新时间
    cargos_week  = [],   %%周刷道具
    time_week    = 0,    %%上次周刷时间
    cargos_forever = []  %%终身道具
}).


%%商品结构
-record(guild_cargo_base,{
    id = 0,
    lv_min = 0,
    lv_max = 0,
    guild_lv = 0,
    cargo = [],
    type = 0, %%0为不限购，1为日限购，2为周限购，3为终身限购
    num = 0,
    cost = []
}).