mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 20:17:24 +08:00
add message to buy torrent success
This commit is contained in:
@@ -262,10 +262,11 @@ class BonusRepository extends BaseRepository
|
|||||||
$userQuery = $userQuery->lockForUpdate();
|
$userQuery = $userQuery->lockForUpdate();
|
||||||
}
|
}
|
||||||
$user = $userQuery->findOrFail($uid);
|
$user = $userQuery->findOrFail($uid);
|
||||||
|
$buyerLocale = $user->locale;
|
||||||
$comment = nexus_trans('bonus.comment_buy_torrent', [
|
$comment = nexus_trans('bonus.comment_buy_torrent', [
|
||||||
'bonus' => $requireBonus,
|
'bonus' => $requireBonus,
|
||||||
'torrent_id' => $torrent->id,
|
'torrent_id' => $torrent->id,
|
||||||
], $user->locale);
|
], $buyerLocale);
|
||||||
do_log("comment: $comment");
|
do_log("comment: $comment");
|
||||||
$this->consumeUserBonus($user, $requireBonus, BonusLogs::BUSINESS_TYPE_BUY_TORRENT, $comment);
|
$this->consumeUserBonus($user, $requireBonus, BonusLogs::BUSINESS_TYPE_BUY_TORRENT, $comment);
|
||||||
TorrentBuyLog::query()->create([
|
TorrentBuyLog::query()->create([
|
||||||
@@ -301,6 +302,18 @@ class BonusRepository extends BaseRepository
|
|||||||
];
|
];
|
||||||
BonusLogs::query()->insert($bonusLog);
|
BonusLogs::query()->insert($bonusLog);
|
||||||
}
|
}
|
||||||
|
$buyTorrentSuccessMessage = [
|
||||||
|
'sender' => 0,
|
||||||
|
'receiver' => $user->id,
|
||||||
|
'added' => now(),
|
||||||
|
'subject' => nexus_trans("message.buy_torrent_success.subject", [], $buyerLocale),
|
||||||
|
'msg' => nexus_trans("message.buy_torrent_success.body", [
|
||||||
|
'torrent_name' => $torrent->name,
|
||||||
|
'bonus' => $requireBonus,
|
||||||
|
'url' => sprintf('details.php?id=%s&hit=1', $torrent->id)
|
||||||
|
], $buyerLocale),
|
||||||
|
];
|
||||||
|
Message::add($buyTorrentSuccessMessage);
|
||||||
});
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -623,6 +623,11 @@ class UserRepository extends BaseRepository
|
|||||||
'claims' => 'uid',
|
'claims' => 'uid',
|
||||||
'exam_users' => 'uid',
|
'exam_users' => 'uid',
|
||||||
'exam_progress' => 'uid',
|
'exam_progress' => 'uid',
|
||||||
|
'user_metas' => 'uid',
|
||||||
|
'user_medals' => 'uid',
|
||||||
|
'attendance' => 'uid',
|
||||||
|
'attendance_logs' => 'uid',
|
||||||
|
'login_logs' => 'uid',
|
||||||
];
|
];
|
||||||
foreach ($tables as $table => $key) {
|
foreach ($tables as $table => $key) {
|
||||||
\Nexus\Database\NexusDB::table($table)->whereIn($key, $uidArr)->delete();
|
\Nexus\Database\NexusDB::table($table)->whereIn($key, $uidArr)->delete();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.4');
|
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.5');
|
||||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-06-18');
|
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-06-30');
|
||||||
defined('IN_TRACKER') || define('IN_TRACKER', false);
|
defined('IN_TRACKER') || define('IN_TRACKER', false);
|
||||||
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
||||||
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
||||||
|
|||||||
@@ -39,4 +39,8 @@ Last login time::last_login_time, IP::last_ip, location::last_location.<br/>
|
|||||||
If it is not your own operation, the account password may have been leaked, please change it in time!
|
If it is not your own operation, the account password may have been leaked, please change it in time!
|
||||||
BODY,
|
BODY,
|
||||||
],
|
],
|
||||||
|
'buy_torrent_success' => [
|
||||||
|
'subject' => 'Successful torrent purchase reminder',
|
||||||
|
'body' => 'You spent :bonus bonus to successfully buy the torrent:[url=:url]:torrent_name[/url]',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -39,4 +39,8 @@ return [
|
|||||||
若不是你本人操作,账号密码可能已经泄露,请及时修改!
|
若不是你本人操作,账号密码可能已经泄露,请及时修改!
|
||||||
BODY,
|
BODY,
|
||||||
],
|
],
|
||||||
|
'buy_torrent_success' => [
|
||||||
|
'subject' => '成功购买种子提醒',
|
||||||
|
'body' => '你花费 :bonus 魔力成功购买了种子:[url=:url]:torrent_name[/url]',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -37,5 +37,9 @@ return [
|
|||||||
上次登錄時間::last_login_time,IP::last_ip,位置::last_location。<br/>
|
上次登錄時間::last_login_time,IP::last_ip,位置::last_location。<br/>
|
||||||
若不是你本人操作,賬號密碼可能已經泄露,請及時修改!
|
若不是你本人操作,賬號密碼可能已經泄露,請及時修改!
|
||||||
BODY,
|
BODY,
|
||||||
]
|
],
|
||||||
|
'buy_torrent_success' => [
|
||||||
|
'subject' => '成功購買種子提醒',
|
||||||
|
'body' => '你花費 :bonus 魔力成功購買了種子:[url=:url]:torrent_name[/url]',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user