123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- <?php
- namespace loyalsoft;
- /**
- * 邮件数据模型
- * @version
- * 1.0.0 Created at 2017-4-27. by --gwang
- * @author gwang (mail@wanggangzero.cn)
- * @copyright ? 2017-4-27, SJZ LoyalSoft Corporation & gwang. All rights reserved.
- */
- class EmailModel extends Object_ext
- {
- /**
- * 邮件编号
- * @var int
- */
- public $mailId;
- /**
- * 发件人uid
- * @var string
- */
- public $uid_sender;
- /**
- * 发件人昵称
- * @var string
- */
- public $name_sender;
- /**
- * 道具Id
- * @var string
- */
- public $itemid;
- /**
- * 道具数量
- * @var int
- */
- public $num;
- /**
- * 邮件类型
- * @var int
- */
- public $type;
- /**
- * 邮件标题
- * @var string
- */
- public $title;
- /**
- * 邮件正文
- * @var string
- */
- public $content;
- /**
- * 附加标签
- * @var obj
- */
- public $tag;
- /**
- * 生效时间
- * @var ts
- */
- public $startts;
- /**
- * 过期时间
- * @var ts
- */
- public $endts;
- /**
- * 领取时间
- * @var ts
- */
- public $drawedts = 0;
- /**
- * 发送时间
- * @var ts
- */
- public $insertts;
- /**
- * 邮件是否已经领取
- * true = 已读
- * @return bool
- */
- public function isDrawed()
- {
- return $this->drawedts > 0;
- }
- /**
- * 邮件是否存在奖励内容
- * true = 有奖励
- * false = 无
- * @return bool
- */
- public function isExistReward()
- {
- return $this->itemid > 0 && $this->num > 0;
- }
- /**
- * 返回: 物品id,数量 的字符串
- * @return string
- */
- public function getRewardStr()
- {
- return $this->itemid . "," . $this->num;
- }
- function __construct($tag = null, $type = 1, $title = "", $content = "", $itemid = 0, $num = 0, #
- $uid_sender = "系统", $name_sender = "系统", $startts = 0, $endts = 1999999999)
- {
- if (1 == func_num_args() && $tag) { # 默认的Object初始化方法
- parent::__construct($tag);
- } else {
- $this->tag = $tag;
- $this->type = $type;
- $this->title = $title;
- $this->content = $content;
- $this->itemid = $itemid;
- $this->num = $num;
- $this->uid_sender = $uid_sender;
- $this->name_sender = $name_sender;
- $this->startts = $startts;
- $this->endts = $endts;
- }
- }
- }
|