Added Shows, ActionFoto's and Attraction Status
This commit is contained in:
parent
b105bd7db7
commit
ad320963fc
30 changed files with 1190 additions and 503 deletions
31
app/User.php
31
app/User.php
|
@ -51,6 +51,37 @@ class User extends Authenticatable implements MustVerifyEmail
|
|||
return $username;
|
||||
}
|
||||
|
||||
private $shows = null;
|
||||
public function hasShows() {
|
||||
if($this->shows !== null)
|
||||
return true;
|
||||
|
||||
$shows = Show::join('seats', 'seats.show_id', '=', 'shows.id')
|
||||
->select([
|
||||
'shows.title', 'shows.description', 'shows.image', 'seats.*'
|
||||
])
|
||||
->where('seats.uuid', '=', $this->uuid)
|
||||
->where('seats.date', '>', 'CURRENT_TIMESTAMP()')
|
||||
->get()->all();
|
||||
$this->shows = $shows;
|
||||
return !empty($shows);
|
||||
}
|
||||
|
||||
public function getShows() {
|
||||
if($this->shows !== null)
|
||||
return $this->shows;
|
||||
|
||||
$shows = Show::join('seats', 'seats.show_id', '=', 'shows.id')
|
||||
->select([
|
||||
'shows.title', 'shows.description', 'shows.image', 'seats.*'
|
||||
])
|
||||
->where('seats.uuid', '=', $this->uuid)
|
||||
->where('seats.date', '>', 'CURRENT_TIMESTAMP()')
|
||||
->get()->all();
|
||||
$this->shows = $shows;
|
||||
return $shows;
|
||||
}
|
||||
|
||||
public function photo() {
|
||||
return 'https://crafatar.com/avatars/'.$this->uuid.'?overlay';
|
||||
}
|
||||
|
|
Reference in a new issue