From b9203f78dc1427643c27ab1ff56ce00ef5b170be Mon Sep 17 00:00:00 2001 From: liutk <961510893@qq.com> Date: Mon, 24 Jun 2024 22:55:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Resources/Api/UserGameResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Resources/Api/UserGameResource.php b/app/Http/Resources/Api/UserGameResource.php index bd38aaa..2c60ae2 100644 --- a/app/Http/Resources/Api/UserGameResource.php +++ b/app/Http/Resources/Api/UserGameResource.php @@ -41,7 +41,7 @@ class UserGameResource extends JsonResource }), 'score' => $this->score, 'status' => $this->whenLoaded('game', function () { - return $this->game?->state ==0 ?'0':($this->is_right ? '1':'2'); + return ($this->game?->state ?? 0) < 2 ?'0':($this->is_right ? '1':'2'); }, '0'), 'history' => $this->whenLoaded('userActivity', function () { return ($this->userActivity->join_times ?? 0).'δΈ­'.($this->userActivity->right_times ?? 0);