mailQueue = ObjectInit(); // $this->mailMaxId = 10000; // $this->sysMailRecord = ArrayInit(); // } // //// ----------- 方法 --------------------- // // // // /** // * 新增系统邮件 // * @param int $sysId 邮件的id // * @param string $title 邮件标题 // * @param type $content 邮件正文 // * @param type $itemid 道具id (附加于tag字段) // * @param type $startts 生效时间 // * @param type $endts 过期时间 // * @param type $interact 目标交互体 // */ // static function insertSysMail($sysId, $title, $content, $itemid, $startts, $endts, &$interact) // { // self::insertMail("0", "系统邮件", "", "", 1, $title, $content, $itemid, $startts, $endts, $interact); // if ($sysId != 0) { // $sysMailRecord = $interact->sysMailRecord; // $sysMailRecord[] = $sysId; // $interact->sysMailRecord = $sysMailRecord; // } // } // // /** // * 新增邮件 // * @param string $fromoid 发送人的oid // * @param type $name 发送人的呢称 // * @param type $pf pf // * @param type $img 图像 // * @param type $type 邮件类型 // * @param string $title 邮件标题 // * @param string $content 邮件正文 // * @param type $tag 额外标签可以传递数据 // * @param ts $startts 生效时间 // * @param ts $endts 过期时间 // * @param UserInteractModel $interact 目标交互体 // * @return void // */ // static function insertMail($fromoid, $name, $pf, $img, $type, $title, $content, $tag, $startts, $endts, &$interact) // { // if (CommUtil::tsCurrent() > $endts) { // return; // } // $interact->mailMaxId++; // $mailMaxId = $interact->mailMaxId; // $mail = new EmailModel; // $mail->fromoid = $fromoid; // $mail->name = $name; // $mail->pf = $pf; // $mail->img = $img; // $mail->type = $type; // $mail->title = $title; // $mail->content = $content; // $mail->tag = $tag; // $mail->startts = $startts; // $mail->endts = $endts; // $mail->ts = CommUtil::tsCurrent(); // $interact->mailQueue->$mailMaxId = $mail; // # 记录日志 // self::_insertMailRecord($interact->oid, $interact->zoneid, $mail, $mailMaxId); // } // // /** // * 插入发送邮件的日志 // * @param string uid // * @param int $zoneid // * @param EmailModel $mail // * @param int $mailId // */ // static function _insertMailRecord($uid, $zoneid, $mail, $mailId) // { // $sql = <<fromoid, $mail->name, # // $mail->pf, $mail->img, $mail->type, $mail->title, $mail->content, # // $mail->tag, $mail->startts, $mail->endts); // daoInst()->query($insertstr); // } // // /** // * 获取邮件序列[自动过滤尚未到(生效)期的邮件,自动删除已过期的邮件] // * @param UserInteractModel $interact Description // */ // static function getMailQueue($interact) // { // $mailList = ObjectInit(); // $mailQueue = $interact->mailQueue; // foreach ($mailQueue as $mailId => $mail) { // $ts = CommUtil::tsCurrent(); // if ($ts >= $mail->startts) { // if ($ts > $mail->endts) { // self::deleteMail($mailId, $interact); // } else { // $mailList->$mailId = $mail; // } // } // } // return $mailList; // } // // /** // * 删除邮件[附件接收完毕之后] // * @param type $mailId // * @param UserInteractModel $interact Description // */ // static function deleteMail($mailId, &$interact) // { // self::_drawMailRecord($mailId, $interact); # 领取记录 // StlUtil::dictRemove($interact->mailQueue, $mailId); // } // // /** // * 更新领取记录 // * @param type $mailId // * @param UserInteractModel $interact // */ // static function _drawMailRecord($mailId, $interact) // { // $sql = "update tab_mailrecord set drawedts=now() where mailId=%d and zoneid=%s and uid=%s;"; // $updatestr = sprintf($sql, $mailId, $interact->zoneid, $interact->uid); // daoInst()->query($updatestr); // } // //// //}