X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FModels%2FUser.php;h=0c2dcf76b0aaaf307c4591f35dc6d2f618b9019e;hb=eca3f0074e6f9e882b91893e554ce249e25338de;hp=e5bb4f174b49b5f2a96446627ab0148421f7f725;hpb=a748d5724c8acff6e3bb3fe6c20aa5968b65d58a;p=alttp.git diff --git a/app/Models/User.php b/app/Models/User.php index e5bb4f1..0c2dcf7 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -56,6 +56,14 @@ class User extends Authenticatable return false; } + public function hasFinished(Round $round) { + foreach ($round->results as $result) { + if ($result->user_id != $this->id) continue; + return $result->has_finished; + } + return false; + } + public function participation() { return $this->hasMany(Participant::class);