swip bonus consume

This commit is contained in:
xiaomlove
2022-07-25 03:37:51 +08:00
parent cc63bb53e6
commit c43ded9369
2 changed files with 0 additions and 5 deletions
-3
View File
@@ -31,7 +31,6 @@ class BonusRepository extends BaseRepository
$comment = nexus_trans('hr.bonus_cancel_comment', [ $comment = nexus_trans('hr.bonus_cancel_comment', [
'bonus' => $requireBonus, 'bonus' => $requireBonus,
], $user->locale); ], $user->locale);
$comment = addslashes($comment);
do_log("comment: $comment"); do_log("comment: $comment");
$this->consumeUserBonus($user, $requireBonus, BonusLogs::BUSINESS_TYPE_CANCEL_HIT_AND_RUN, "$comment(H&R ID: {$hitAndRun->id})"); $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, 'bonus' => $requireBonus,
'medal_name' => $medal->name, 'medal_name' => $medal->name,
], $user->locale); ], $user->locale);
$comment = addslashes($comment);
do_log("comment: $comment"); do_log("comment: $comment");
$this->consumeUserBonus($user, $requireBonus, BonusLogs::BUSINESS_TYPE_BUY_MEDAL, "$comment(medal ID: {$medal->id})"); $this->consumeUserBonus($user, $requireBonus, BonusLogs::BUSINESS_TYPE_BUY_MEDAL, "$comment(medal ID: {$medal->id})");
$expireAt = null; $expireAt = null;
@@ -85,7 +83,6 @@ class BonusRepository extends BaseRepository
$comment = nexus_trans('bonus.comment_buy_attendance_card', [ $comment = nexus_trans('bonus.comment_buy_attendance_card', [
'bonus' => $requireBonus, 'bonus' => $requireBonus,
], $user->locale); ], $user->locale);
$comment = addslashes($comment);
do_log("comment: $comment"); do_log("comment: $comment");
$this->consumeUserBonus($user, $requireBonus, BonusLogs::BUSINESS_TYPE_BUY_ATTENDANCE_CARD, $comment); $this->consumeUserBonus($user, $requireBonus, BonusLogs::BUSINESS_TYPE_BUY_ATTENDANCE_CARD, $comment);
User::query()->where('id', $user->id)->increment('attendance_card'); User::query()->where('id', $user->id)->increment('attendance_card');
-2
View File
@@ -658,7 +658,6 @@ if ($action == "exchange") {
stderr("Error","Invalid Medal ID: " . ($_POST['medal_id'] ?? ''), false, false); stderr("Error","Invalid Medal ID: " . ($_POST['medal_id'] ?? ''), false, false);
} }
try { try {
$bonusRep = new \App\Repositories\BonusRepository();
$bonusRep->consumeToBuyMedal($userid, $_POST['medal_id']); $bonusRep->consumeToBuyMedal($userid, $_POST['medal_id']);
nexus_redirect("" . get_protocol_prefix() . "$BASEURL/mybonus.php?do=buy_medal"); nexus_redirect("" . get_protocol_prefix() . "$BASEURL/mybonus.php?do=buy_medal");
} catch (\Exception $exception) { } catch (\Exception $exception) {
@@ -667,7 +666,6 @@ if ($action == "exchange") {
} }
} elseif ($art == 'attendance_card') { } elseif ($art == 'attendance_card') {
try { try {
$bonusRep = new \App\Repositories\BonusRepository();
$bonusRep->consumeToBuyAttendanceCard($userid); $bonusRep->consumeToBuyAttendanceCard($userid);
nexus_redirect("" . get_protocol_prefix() . "$BASEURL/mybonus.php?do=attendance_card"); nexus_redirect("" . get_protocol_prefix() . "$BASEURL/mybonus.php?do=attendance_card");
} catch (\Exception $exception) { } catch (\Exception $exception) {