This commit is contained in:
aozhiwei 2024-06-04 19:32:35 +08:00
parent 18a8d9d32e
commit e3e9ea64be

View File

@ -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)
{
}