mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
swip bonus consume
This commit is contained in:
@@ -31,7 +31,6 @@ class BonusRepository extends BaseRepository
|
||||
$comment = nexus_trans('hr.bonus_cancel_comment', [
|
||||
'bonus' => $requireBonus,
|
||||
], $user->locale);
|
||||
$comment = addslashes($comment);
|
||||
do_log("comment: $comment");
|
||||
|
||||
$this->consumeUserBonus($user, $requireBonus, BonusLogs::BUSINESS_TYPE_CANCEL_HIT_AND_RUN, "$comment(H&R ID: {$hitAndRun->id})");
|
||||
@@ -62,7 +61,6 @@ class BonusRepository extends BaseRepository
|
||||
'bonus' => $requireBonus,
|
||||
'medal_name' => $medal->name,
|
||||
], $user->locale);
|
||||
$comment = addslashes($comment);
|
||||
do_log("comment: $comment");
|
||||
$this->consumeUserBonus($user, $requireBonus, BonusLogs::BUSINESS_TYPE_BUY_MEDAL, "$comment(medal ID: {$medal->id})");
|
||||
$expireAt = null;
|
||||
@@ -85,7 +83,6 @@ class BonusRepository extends BaseRepository
|
||||
$comment = nexus_trans('bonus.comment_buy_attendance_card', [
|
||||
'bonus' => $requireBonus,
|
||||
], $user->locale);
|
||||
$comment = addslashes($comment);
|
||||
do_log("comment: $comment");
|
||||
$this->consumeUserBonus($user, $requireBonus, BonusLogs::BUSINESS_TYPE_BUY_ATTENDANCE_CARD, $comment);
|
||||
User::query()->where('id', $user->id)->increment('attendance_card');
|
||||
|
||||
@@ -658,7 +658,6 @@ if ($action == "exchange") {
|
||||
stderr("Error","Invalid Medal ID: " . ($_POST['medal_id'] ?? ''), false, false);
|
||||
}
|
||||
try {
|
||||
$bonusRep = new \App\Repositories\BonusRepository();
|
||||
$bonusRep->consumeToBuyMedal($userid, $_POST['medal_id']);
|
||||
nexus_redirect("" . get_protocol_prefix() . "$BASEURL/mybonus.php?do=buy_medal");
|
||||
} catch (\Exception $exception) {
|
||||
@@ -667,7 +666,6 @@ if ($action == "exchange") {
|
||||
}
|
||||
} elseif ($art == 'attendance_card') {
|
||||
try {
|
||||
$bonusRep = new \App\Repositories\BonusRepository();
|
||||
$bonusRep->consumeToBuyAttendanceCard($userid);
|
||||
nexus_redirect("" . get_protocol_prefix() . "$BASEURL/mybonus.php?do=attendance_card");
|
||||
} catch (\Exception $exception) {
|
||||
|
||||
Reference in New Issue
Block a user