diff --git a/webapp/services/MailApiService.php b/webapp/services/MailApiService.php index 0318ccef..83b0fda9 100644 --- a/webapp/services/MailApiService.php +++ b/webapp/services/MailApiService.php @@ -25,7 +25,7 @@ class MailApiService extends BaseService { $unikey = self::SELL_UNIKEY_PRE . $oderId; SqlHelper::upsert (myself()->_getMailMysql(), - 't_used_name', + 't_sys_mail', array( 'unikey' => $unikey ), @@ -41,6 +41,8 @@ class MailApiService extends BaseService { ) )), 'attachments' => json_encode($attachments), + 'tag1' => 1, + 'tag2' => 1, 'sendtime' => myself()->_getNowTime(), 'expiretime' => myself()->_getNowTime() + 3600 * 24 * 365 * 10, 'createtime' => myself()->_getNowTime(), @@ -64,7 +66,33 @@ class MailApiService extends BaseService { */ 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() + ) + ); } }