1
This commit is contained in:
parent
3121e7dfb4
commit
7d7df2f41d
@ -4,6 +4,7 @@ namespace models;
|
|||||||
|
|
||||||
require_once('services/AwardService.php');
|
require_once('services/AwardService.php');
|
||||||
require_once('services/PropertyChgService.php');
|
require_once('services/PropertyChgService.php');
|
||||||
|
require_once('services/MailApiService.php');
|
||||||
|
|
||||||
class GoldBullion extends BaseModel {
|
class GoldBullion extends BaseModel {
|
||||||
|
|
||||||
@ -80,9 +81,15 @@ class GoldBullion extends BaseModel {
|
|||||||
'idx' => $row['idx'],
|
'idx' => $row['idx'],
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
|
'account_id' => myself()->_getAccountId(),
|
||||||
'open_status' => self::OPEN_STATUS_SEND_END,
|
'open_status' => self::OPEN_STATUS_SEND_END,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
$content = "[Item Name] has been used successfully, you have received 100,000 gold";
|
||||||
|
services\MailApiService::sendOpenGold($row['net_id'],
|
||||||
|
$row['token_id'],
|
||||||
|
'',
|
||||||
|
$content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ class MailApiService extends BaseService {
|
|||||||
|
|
||||||
const SELL_UNIKEY_PRE = 'ingame.market.sell:';
|
const SELL_UNIKEY_PRE = 'ingame.market.sell:';
|
||||||
const BUY_UNIKEY_PRE = 'ingame.market.buy:';
|
const BUY_UNIKEY_PRE = 'ingame.market.buy:';
|
||||||
|
const OPEN_GOLD_BULLION_UNIKEY_PRE = 'gold_bullion:open:';
|
||||||
|
|
||||||
const SELL_MAIL_SUBJECT = 'Item successfully sold';
|
const SELL_MAIL_SUBJECT = 'Item successfully sold';
|
||||||
/*
|
/*
|
||||||
@ -98,6 +99,44 @@ class MailApiService extends BaseService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
netId: netId
|
||||||
|
tokenId:tokenid
|
||||||
|
to:邮件接受方account_id
|
||||||
|
subject: 邮件标题
|
||||||
|
content: 邮件正文
|
||||||
|
*/
|
||||||
|
public function sendOpenGold($netId, $tokenId, $subject, $content)
|
||||||
|
{
|
||||||
|
$unikey = self::OPEN_GOLD_BULLION_UNIKEY_PRE . $netId . '_' . $tokenId;
|
||||||
|
SqlHelper::upsert
|
||||||
|
(myself()->_getMailMysql(),
|
||||||
|
't_sys_mail',
|
||||||
|
array(
|
||||||
|
'unikey' => $unikey
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'unikey' => $unikey,
|
||||||
|
'subject' => $subject,
|
||||||
|
'content' => $content,
|
||||||
|
'recipients' => json_encode(array(
|
||||||
|
$to
|
||||||
|
)),
|
||||||
|
'attachments' => json_encode(array()),
|
||||||
|
'tag1' => 1,
|
||||||
|
'tag2' => 3,
|
||||||
|
'sendtime' => myself()->_getNowTime(),
|
||||||
|
'expiretime' => myself()->_getNowTime() + 3600 * 24 * 365 * 10,
|
||||||
|
'user_reg_start_time' => 0,
|
||||||
|
'user_reg_end_time' => myself()->_getNowTime() + 3600 * 24 * 365 * 10,
|
||||||
|
'createtime' => myself()->_getNowTime(),
|
||||||
|
'modifytime' => myself()->_getNowTime()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
private function adjustAttachments(&$attachments)
|
private function adjustAttachments(&$attachments)
|
||||||
{
|
{
|
||||||
if (empty($attachments)) {
|
if (empty($attachments)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user