TimeLogger moved, League ranking also for not completed but started rounds
This commit is contained in:
parent
78a4a04cdf
commit
90c6d60ecd
26 changed files with 692 additions and 376 deletions
|
|
@ -9,6 +9,7 @@ use App\Season;
|
|||
use Log;
|
||||
use DB;
|
||||
use Carbon;
|
||||
use App\MyClasses\TimeLogger;
|
||||
|
||||
class Round extends Model
|
||||
{
|
||||
|
|
@ -127,22 +128,28 @@ class Round extends Model
|
|||
}
|
||||
|
||||
public static function getFirstTippableRound($seasonId=-1) {
|
||||
|
||||
$season=null;
|
||||
if ($seasonId==-1) {
|
||||
$season=Season::getCurrent();
|
||||
} else {
|
||||
$season=Season::where('id','=', $seasonId)->first();
|
||||
}
|
||||
if (!$season) return null;
|
||||
if (!$season) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$rounds=Round::where('season_id','=',$season->id)->orderBy('id')->get();
|
||||
|
||||
$locked = false;
|
||||
foreach ($rounds as $round) {
|
||||
if (!Round::hasLockedGame($round->id) ) {
|
||||
if (!Round::hasLockedGame($round->id)) {
|
||||
return $round;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue