_getMailMysql(), 't_sys_mail', array( 'unikey' => $unikey ), array( ), array( 'unikey' => $unikey, 'subject' => $subject, 'content' => $content, 'recipients' => json_encode(array( array( 'account_id' => $to, ) )), 'attachments' => json_encode($attachments), 'tag1' => 1, 'tag2' => 1, 'sendtime' => myself()->_getNowTime(), 'expiretime' => myself()->_getNowTime() + 3600 * 24 * 365 * 10, 'createtime' => myself()->_getNowTime(), 'modifytime' => myself()->_getNowTime() ) ); } /* orderId:订单id to:邮件接受方account_id subject: 邮件标题 content: 邮件正文 attachments: 邮件附件 [ { "itemid": 0, //道具id "itemnum": 0, //道具数量 } ] */ public function sendBuyMail($orderId, $to, $subject, $content, $attachments) { $unikey = self::BUY_UNIKEY_PRE . $oderId; SqlHelper::upsert (myself()->_getMailMysql(), 't_sys_mail', array( 'unikey' => $unikey ), array( ), array( 'unikey' => $unikey, 'subject' => $subject, 'content' => $content, 'recipients' => json_encode(array( array( 'account_id' => $to, ) )), 'attachments' => json_encode($attachments), 'tag1' => 1, 'tag2' => 2, 'sendtime' => myself()->_getNowTime(), 'expiretime' => myself()->_getNowTime() + 3600 * 24 * 365 * 10, 'createtime' => myself()->_getNowTime(), 'modifytime' => myself()->_getNowTime() ) ); } }