From db6b0eff95e209c1791662ed9b21188e4f3c6857 Mon Sep 17 00:00:00 2001 From: sephger Date: Mon, 22 Apr 2024 15:46:40 +0200 Subject: [PATCH] Raid anmeldung 2.0 --- theme/components/raid-signup.php | 8 +++++--- theme/pages/roster.php | 4 ++++ theme/wowpress/Database/CreateCharacterTable.php | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/theme/components/raid-signup.php b/theme/components/raid-signup.php index 7986baf..c11826c 100644 --- a/theme/components/raid-signup.php +++ b/theme/components/raid-signup.php @@ -7,12 +7,14 @@ use WoWPress\Models\Signup; $id = "raidSignup_" . uniqid(); global $user; +$chars = []; if(!empty($this->character->user->ID)){ - $chars = $this->character->user->characters; -}else{ - $chars = [$this->character]; + $chars = $this->character->user->characters()->where('raidchar',true)->get(); } +if(empty($chars) || empty($chars->first())){ + $chars = [$this->character]; +} ?>
border border-character->color ?> shadow" x-data="{open : false}"> diff --git a/theme/pages/roster.php b/theme/pages/roster.php index cf63f32..cb9cec8 100644 --- a/theme/pages/roster.php +++ b/theme/pages/roster.php @@ -31,6 +31,8 @@ get_header(); Rang Server Gilde + Raider + User @@ -59,6 +61,8 @@ get_header(); rank ?> realm ?> guild ?> + raidchar?"Ja":"Nein" ?> +
diff --git a/theme/wowpress/Database/CreateCharacterTable.php b/theme/wowpress/Database/CreateCharacterTable.php index b9c8329..0437574 100644 --- a/theme/wowpress/Database/CreateCharacterTable.php +++ b/theme/wowpress/Database/CreateCharacterTable.php @@ -13,6 +13,7 @@ class CreateCharacterTable extends CreateTable 'spec' => "text DEFAULT Brave", 'id_blizz' => 'mediumint', 'id_wowaudit' => 'mediumint', + 'raidchar' => 'boolean DEFAULT 0', 'guild' => "text", 'rank' => 'tinyint DEFAULT 99', 'user_id' => 'mediumint',