diff --git a/app/Models/Host.php b/app/Models/Host.php index d7f7acc..01e2d72 100644 --- a/app/Models/Host.php +++ b/app/Models/Host.php @@ -142,6 +142,13 @@ public function cost($price = null, $auto = true) broadcast(new UserEvent($this->user_id, 'balances.drops.reduced', $this->user)); + // 检测用户余额是否足够 + if ($this->user->balance < 0) { + $this->update([ + 'status' => 'suspended', + ]); + } + return true; }