UserLotteryModel.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <?php
  2. namespace loyalsoft;
  3. /**
  4. * 抽奖卡槽
  5. */
  6. class LotterySlotModel extends Object_ext
  7. {
  8. /*
  9. * 有4个卡槽, 按照等级解锁, 可花钻石提前解锁,
  10. * 每个卡槽上可以托管一张抽奖后获得的英雄. 并开始冷却计时
  11. * 冷却计时完成后, 可以收取对应的卡牌
  12. * 涉及到的数据结构:
  13. * 卡槽id,
  14. * 解锁状态,
  15. * 英雄modle_id,
  16. * 英雄星级,
  17. * 冷却时间,
  18. */
  19. /**
  20. * @var int 卡槽id
  21. */
  22. public $id;
  23. /**
  24. * @var bool 解锁状态
  25. */
  26. public $locked = true;
  27. /**
  28. * @var int 英雄(原型)编号
  29. */
  30. public $herotype = 0;
  31. /**
  32. * @var int 英雄(实例)星级
  33. */
  34. public $herostar = 0;
  35. /**
  36. * @var ts 开放时间戳
  37. */
  38. public $opents = 0;
  39. public function Clear()
  40. {
  41. $this->herostar = 0;
  42. $this->herotype = 0;
  43. $this->opents = 0;
  44. }
  45. }
  46. /**
  47. * 设计一些卡槽
  48. * @version
  49. * 1.0.0 Created at 2017-7-20. by --gwang
  50. * @author gwang (mail@wanggangzero.cn)
  51. * @copyright ? 2017-7-20, SJZ LoyalSoft Corporation & gwang. All rights reserved.
  52. */
  53. class UserLotteryModel extends Object_ext
  54. {
  55. /**
  56. * @var {} 当天抽奖记录(类型=>次数)
  57. */
  58. public $todayLotterys;
  59. /**
  60. * @var {} 总的抽奖记录(类型=>次数)
  61. */
  62. public $totalLotterys;
  63. /**
  64. * @var {} 保底奖励计数器(类型=>次数)
  65. */
  66. public $baodiLotterys;
  67. /**
  68. * @var {} 保底奖励领取记录(类型=>次数)
  69. */
  70. public $baodiDrawed;
  71. public function __construct($arg = null)
  72. {
  73. if (func_num_args() == 1 && !is_null($arg)) {
  74. parent::__construct($arg);
  75. }
  76. if (!isset($this->slot0)) {
  77. $this->slot0 = new LotterySlotModel(array('id' => 0, 'locked' => false));
  78. }
  79. if (!isset($this->slot1)) {
  80. $this->slot1 = new LotterySlotModel(array('id' => 1));
  81. }
  82. if (!isset($this->slot2)) {
  83. $this->slot2 = new LotterySlotModel(array('id' => 2));
  84. }
  85. if (!isset($this->slot3)) {
  86. $this->slot3 = new LotterySlotModel(array('id' => 3));
  87. }
  88. if (!isset($this->todayLotterys)) {
  89. $this->todayLotterys = ObjectInit();
  90. }
  91. if (!isset($this->totalLotterys)) {
  92. $this->totalLotterys = ObjectInit();
  93. }
  94. if (!isset($this->baodiLotterys)) {
  95. $this->baodiLotterys = ObjectInit();
  96. }
  97. if (!isset($this->baodiDrawed)) {
  98. $this->baodiDrawed = ObjectInit();
  99. }
  100. }
  101. }