源战役
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 line
1.7 KiB

  1. %%-----------------------------------------------------------------------------
  2. %% @Module : lucky_flop
  3. %% @Author : WJQ
  4. %% @Created : 2019-07-17
  5. %% @Description: 幸运翻牌
  6. %%-----------------------------------------------------------------------------
  7. -define(NOT_GET, 0). %% 未抽取
  8. -define(HAS_GET, 1). %% 已抽取
  9. %% 玩家幸运翻牌数据
  10. -record(lucky_flop, {
  11. data_map = #{} %% #{SubType => #lucky_flop_data{}}
  12. }).
  13. %% 单个子类型数据
  14. -record(lucky_flop_data, {
  15. sub_type = 0, %% 活动子类型
  16. now_times = 0, %% 当前抽奖次数
  17. total_times = 0, %% 累计抽奖次数
  18. turn = 0, %% 当前抽奖轮数
  19. draw_rewards = [], %% 奖池列表[{奖励档次,是否已获取},...]
  20. receive_rewards = [], %% 已领取累计奖励列表[奖励档次,...]
  21. time = 0 %% 更新时间
  22. }).
  23. -define(SELECT_LUCKY_FLOP,
  24. <<"SELECT `sub_type`, `now_times`, `total_times`, `turn`, `draw_rewards`, `receive_rewards`, `time`
  25. FROM `lucky_flop` WHERE `role_id` = ~p ">>).
  26. -define(SELECT_ALL_LUCKY_FLOP,
  27. <<"SELECT `role_id`, `now_times`, `receive_rewards` FROM `lucky_flop` WHERE `sub_type` = ~p ">>).
  28. -define(REPLACE_LUCKY_FLOP,
  29. <<"REPLACE `lucky_flop`(`role_id`, `sub_type`, `now_times`, `total_times`, `turn`, `draw_rewards`, `receive_rewards`, `time`)
  30. VALUES(~p, ~p, ~p, ~p, ~p, '~s', '~s', ~p)">>).
  31. -define(DELETE_LUCKY_FLOP_BY_SUB_TYPE, <<"DELETE FROM `lucky_flop` WHERE `sub_type` = ~p">>).
  32. -define(DELETE_LUCKY_FLOP_ROLE, <<"DELETE FROM `lucky_flop` WHERE `role_id` = ~p AND `sub_type` IN (~s)">>).