mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 12:30:49 +08:00
normalize HitAndRun::getIsEnabled()
This commit is contained in:
@@ -13,8 +13,7 @@ class BonusRepository extends BaseRepository
|
||||
{
|
||||
public function consumeToCancelHitAndRun($uid, $hitAndRunId)
|
||||
{
|
||||
$hitAndRunMode = Setting::get('hr.mode');
|
||||
if ($hitAndRunMode == HitAndRun::MODE_DISABLED) {
|
||||
if (!HitAndRun::getIsEnabled()) {
|
||||
throw new \LogicException("H&R not enabled.");
|
||||
}
|
||||
$user = User::query()->findOrFail($uid);
|
||||
@@ -44,6 +43,7 @@ class BonusRepository extends BaseRepository
|
||||
'now' => Carbon::now()->toDateTimeString(),
|
||||
'bonus' => $requireBonus,
|
||||
], $user->locale);
|
||||
$comment = addslashes($comment);
|
||||
do_log("comment: $comment");
|
||||
$hitAndRun->update([
|
||||
'status' => HitAndRun::STATUS_PARDONED,
|
||||
|
||||
Reference in New Issue
Block a user