$this->activity_id, 'user_id' => $this->user_id, 'nick_name' => $this->whenLoaded('user', function () { return $this->user?->nick_name ?? ''; }, ''), 'avatar' => $this->whenLoaded('user', function () { return $this->user?->avatar ?? ''; }, ''), 'game_name' => $this->whenLoaded('game', function () { return $this->game?->name ?? ''; }, ''), 'game_home_field' => $this->whenLoaded('game', function () { return $this->game?->home_field ?? ''; }, ''), 'game_away' => $this->whenLoaded('game', function () { return $this->game?->away ?? ''; }, ''), 'game_at' => $this->whenLoaded('game', function () { return $this->game?->game_at ? $this->game->game_at->format('Y-m-d H:i:s'): ''; }), 'game_day' => $this->whenLoaded('game', function () { return $this->game?->game_at ? $this->game->game_at->format('Y-m-d'): ''; }), 'score' => $this->score, 'status' => $this->whenLoaded('game', function () { return $this->game?->state ==0 ?'0':($this->is_right ? '1':'2'); }, '0'), 'history' => $this->whenLoaded('userActivity', function () { return ($this->userActivity->join_times ?? 0).'δΈ­'.($this->userActivity->right_times ?? 0); }, ''), ]; } public function with($request) { return ['code' => Response::HTTP_OK, 'message' => '']; } }