mirror of
https://code.castopod.org/adaures/castopod.git
synced 2024-09-06 18:59:20 +02:00
ed6e953010
- add .editorconfig file - format all files to comply with castopod's coding style - switch parsedown dependency with commonmark library to better follow commonmark spec for markdown - add prettier command to format all project files at once closes #16
29 lines
860 B
PHP
29 lines
860 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
class UserModel extends \Myth\Auth\Models\UserModel
|
|
{
|
|
protected $returnType = \App\Entities\User::class;
|
|
|
|
public function getPodcastContributors($podcast_id)
|
|
{
|
|
return $this->select('users.*, auth_groups.name as podcast_role')
|
|
->join('users_podcasts', 'users_podcasts.user_id = users.id')
|
|
->join('auth_groups', 'auth_groups.id = users_podcasts.group_id')
|
|
->where('users_podcasts.podcast_id', $podcast_id)
|
|
->findAll();
|
|
}
|
|
|
|
public function getPodcastContributor($user_id, $podcast_id)
|
|
{
|
|
return $this->select('users.*')
|
|
->join('users_podcasts', 'users_podcasts.user_id = users.id')
|
|
->where([
|
|
'users.id' => $user_id,
|
|
'podcast_id' => $podcast_id,
|
|
])
|
|
->first();
|
|
}
|
|
}
|