%%----------------------------------------------------------------------------- %% @Module : lucky_flop %% @Author : WJQ %% @Created : 2019-07-17 %% @Description: 幸运翻牌 %%----------------------------------------------------------------------------- -define(NOT_GET, 0). %% 未抽取 -define(HAS_GET, 1). %% 已抽取 %% 玩家幸运翻牌数据 -record(lucky_flop, { data_map = #{} %% #{SubType => #lucky_flop_data{}} }). %% 单个子类型数据 -record(lucky_flop_data, { sub_type = 0, %% 活动子类型 now_times = 0, %% 当前抽奖次数 total_times = 0, %% 累计抽奖次数 turn = 0, %% 当前抽奖轮数 draw_rewards = [], %% 奖池列表[{奖励档次,是否已获取},...] receive_rewards = [], %% 已领取累计奖励列表[奖励档次,...] time = 0 %% 更新时间 }). -define(SELECT_LUCKY_FLOP, <<"SELECT `sub_type`, `now_times`, `total_times`, `turn`, `draw_rewards`, `receive_rewards`, `time` FROM `lucky_flop` WHERE `role_id` = ~p ">>). -define(SELECT_ALL_LUCKY_FLOP, <<"SELECT `role_id`, `now_times`, `receive_rewards` FROM `lucky_flop` WHERE `sub_type` = ~p ">>). -define(REPLACE_LUCKY_FLOP, <<"REPLACE `lucky_flop`(`role_id`, `sub_type`, `now_times`, `total_times`, `turn`, `draw_rewards`, `receive_rewards`, `time`) VALUES(~p, ~p, ~p, ~p, ~p, '~s', '~s', ~p)">>). -define(DELETE_LUCKY_FLOP_BY_SUB_TYPE, <<"DELETE FROM `lucky_flop` WHERE `sub_type` = ~p">>). -define(DELETE_LUCKY_FLOP_ROLE, <<"DELETE FROM `lucky_flop` WHERE `role_id` = ~p AND `sub_type` IN (~s)">>).