Working on Qualification Pairings
This commit is contained in:
parent
9c0f94758d
commit
a66189ca00
19 changed files with 9005 additions and 237 deletions
|
|
@ -4,6 +4,8 @@ namespace App\Leagues;
|
|||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
use App\User;
|
||||
|
||||
class LeagueMember extends Model
|
||||
{
|
||||
protected $table ='leagues_members';
|
||||
|
|
@ -11,4 +13,19 @@ class LeagueMember extends Model
|
|||
'id','user_id','league_id'
|
||||
];
|
||||
//
|
||||
|
||||
public static function getMembers($league_id) {
|
||||
$members =LeagueMember::where('league_id','=',$league_id)->orderBy('id')->get();
|
||||
return $members;
|
||||
}
|
||||
|
||||
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