Removed vendors dir, made Leagues dir uppercase
This commit is contained in:
parent
11b737ebf7
commit
9441631dd4
6 changed files with 211187 additions and 0 deletions
36
pfosten/app/Leagues/LeagueMember.php
Normal file
36
pfosten/app/Leagues/LeagueMember.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
namespace App\Leagues;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
use App\User;
|
||||
|
||||
class LeagueMember extends Model
|
||||
{
|
||||
protected $table ='leagues_members';
|
||||
protected $fillable = [
|
||||
'id','user_id','league_id'
|
||||
];
|
||||
//
|
||||
|
||||
public static function getMembers($league_id) {
|
||||
$members =LeagueMember::where('league_id','=',$league_id)->orderBy('id')->get();
|
||||
$userList=array();
|
||||
foreach($members as $member) {
|
||||
array_push($userList,$member->user_id);
|
||||
}
|
||||
return $userList;
|
||||
}
|
||||
|
||||
public static function playsInRound($userId, $roundId, $leagueId) {
|
||||
$matches1 = Match::where('user1_id','=',$userId)->where('round_id','=',$roundId)->where('league_id','=',$leagueId)->get();
|
||||
if (sizeof($matches1)>0) return true;
|
||||
|
||||
|
||||
$matches2 = Match::where('user2_id','=',$userId)->where('round_id','=',$roundId)->where('league_id','=',$leagueId)->get();
|
||||
return sizeof($matches2)>0;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue