From e3e9ea64beaac0a194996aedf139067e7460d0e9 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 4 Jun 2024 19:32:35 +0800 Subject: [PATCH] 1 --- webapp/services/MailApiService.php | 35 +++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/webapp/services/MailApiService.php b/webapp/services/MailApiService.php index 763a203f..91bb2983 100644 --- a/webapp/services/MailApiService.php +++ b/webapp/services/MailApiService.php @@ -4,9 +4,13 @@ namespace services; class MailApiService extends BaseService { + const SELL_UNIKEY_PRE = 'ingame.market.sell:'; + const BUY_UNIKEY_PRE = 'ingame.market.buy:'; + /* orderId:订单id to:邮件接受方account_id + subject: 邮件标题 content: 邮件正文 attachments: 邮件附件 [ @@ -16,14 +20,39 @@ class MailApiService extends BaseService { } ] */ - public function sendSellMail($orderId, $to, $content, $attachments) + public function sendSellMail($orderId, $to, $subject, $content, $attachments) { - + $unikey = self::SELL_UNIKEY_PRE . $oderId; + SqlHelper::upsert + (myself()->_getMailMysql(), + 't_used_name', + array( + 'unikey' => $unikey + ), + array( + ), + array( + 'unikey' => $unikey, + 'subject' => $subject, + 'content' => $content, + 'recipients' => array( + array( + 'account_id' => $to, + ) + ), + 'attachments' => json_encode($attachments), + 'sendtime' => myself()->_getNowTime(), + 'expiretime' => myself()->_getNowTime() + 3600 * 24 * 365 * 10, + 'createtime' => myself()->_getNowTime(), + 'modifytime' => myself()->_getNowTime() + ) + ); } /* orderId:订单id to:邮件接受方account_id + subject: 邮件标题 content: 邮件正文 attachments: 邮件附件 [ @@ -33,7 +62,7 @@ class MailApiService extends BaseService { } ] */ - public function sendBuyMail($orderId, $to, $content, $attachments) + public function sendBuyMail($orderId, $to, $subject, $content, $attachments) { }