Bugfix Round::getFirstTippableRound
This commit is contained in:
parent
c337916a3b
commit
922db48c36
3 changed files with 12518 additions and 5 deletions
12508
d0274241_2017-11-09_1714.sql
Normal file
12508
d0274241_2017-11-09_1714.sql
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -137,7 +137,11 @@ class TippsController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
$tippLink="/tipps#".\App\Round::getFirstTippableRound()->id;
|
|
||||||
|
$tippLink="/tipps#";
|
||||||
|
$r=\App\Round::getFirstTippableRound();
|
||||||
|
if($r) $tippLink=$tippLink.$r->id;
|
||||||
|
|
||||||
// Redirect to the Rounds Index
|
// Redirect to the Rounds Index
|
||||||
return redirect($tippLink);
|
return redirect($tippLink);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -125,9 +125,9 @@ class Round extends Model
|
||||||
public static function getFirstTippableRoundId($seasonId=-1) {
|
public static function getFirstTippableRoundId($seasonId=-1) {
|
||||||
$season=null;
|
$season=null;
|
||||||
if ($seasonId==-1) {
|
if ($seasonId==-1) {
|
||||||
$currentSeason=Season::getCurrent();
|
$season=Season::getCurrent();
|
||||||
} else {
|
} else {
|
||||||
$currentSeason=Season::where('id','=', $seasonId)->first();
|
$season=Season::where('id','=', $seasonId)->first();
|
||||||
}
|
}
|
||||||
if (!$season) return null;
|
if (!$season) return null;
|
||||||
|
|
||||||
|
|
@ -139,13 +139,14 @@ class Round extends Model
|
||||||
public static function getFirstTippableRound($seasonId=-1) {
|
public static function getFirstTippableRound($seasonId=-1) {
|
||||||
$season=null;
|
$season=null;
|
||||||
if ($seasonId==-1) {
|
if ($seasonId==-1) {
|
||||||
$currentSeason=Season::getCurrent();
|
$season=Season::getCurrent();
|
||||||
} else {
|
} else {
|
||||||
$currentSeason=Season::where('id','=', $seasonId)->first();
|
$season=Season::where('id','=', $seasonId)->first();
|
||||||
}
|
}
|
||||||
if (!$season) return null;
|
if (!$season) return null;
|
||||||
|
|
||||||
$rounds=Round::where('season_id','=',$season->id)->orderBy('id')->get();
|
$rounds=Round::where('season_id','=',$season->id)->orderBy('id')->get();
|
||||||
|
|
||||||
$locked = false;
|
$locked = false;
|
||||||
foreach ($rounds as $round) {
|
foreach ($rounds as $round) {
|
||||||
if (!Round::hasLockedGame($round->id) ) {
|
if (!Round::hasLockedGame($round->id) ) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue