源战役
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.

25 lines
957 B

пре 4 недеља
  1. %% ----------------------------------------
  2. %% desc:物品转换头文件
  3. %%
  4. %% ----------------------------------------
  5. %% 转换时间在24小时又10秒内则设置定时器
  6. -define(INTERVAL_TIME, (24 * 60 * 60 + 10) * 1000).
  7. -record(goods_convert, {
  8. goods_id = 0 %% 物品类型ID
  9. , min_num = 0 %% 原物品数量
  10. , goods_convert = 0 %% 转换后物品ID
  11. , get_num = 0 %% 兑换物数量
  12. , convert_time = 0 %% 转换时间
  13. }).
  14. %% 进程状态,用于记录下个物品转换时间
  15. -record(convert_state, {
  16. next_time = 0 %% 下一次需要转换物品的时间
  17. , ref = undefined %% 物品转换定时器
  18. }).
  19. % ------------------------- SQL -------------------------
  20. -define(SELECT_GOODS_INFO_BY_ID, <<"select role_id, num from goods where goods_id = ~p">>).
  21. -define(DELETE_ALL_GOODS_BY_ID, <<"delete from goods where goods_id = ~p">>).