116 lines
2.9 KiB
PHP
116 lines
2.9 KiB
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Log;
|
|
use DB;
|
|
|
|
class Quota extends Model
|
|
{
|
|
public static function createDefaultQuota($season_id)
|
|
{
|
|
|
|
DB::table('quotas')->where('season_id', '=', $season_id)->delete();
|
|
|
|
Log::info("Creating new Quota");
|
|
$quota = new Quota;
|
|
$quota->season_id = $season_id;
|
|
$quota->qtype = "SPIELMODUS";
|
|
$quota->name = "Tagessieg";
|
|
$quota->prc = 50;
|
|
$quota->save();
|
|
|
|
|
|
$quota = new Quota;
|
|
$quota->season_id = $season_id;
|
|
$quota->qtype = "SPIELMODUS";
|
|
$quota->name = "Rangsieg";
|
|
$quota->prc = 50;
|
|
$quota->save();
|
|
|
|
/// #######################################
|
|
|
|
// Sub-Quotas für den Spielmodus 'Tagessieg'
|
|
|
|
$quota = new Quota;
|
|
$quota->season_id = $season_id;
|
|
$quota->qtype = "PLATZIERUNG";
|
|
$quota->name = "Platz 1";
|
|
$quota->order = 1;
|
|
$quota->prc = 21;
|
|
$quota->save();
|
|
|
|
$quota = new Quota;
|
|
$quota->season_id = $season_id;
|
|
$quota->qtype = "PLATZIERUNG";
|
|
$quota->name = "Platz 2";
|
|
$quota->order = 2;
|
|
$quota->prc = 17;
|
|
$quota->save();
|
|
|
|
$quota = new Quota;
|
|
$quota->season_id = $season_id;
|
|
$quota->qtype = "PLATZIERUNG";
|
|
$quota->name = "Platz 3";
|
|
$quota->order = 3;
|
|
$quota->prc = 13;
|
|
$quota->save();
|
|
|
|
$quota = new Quota;
|
|
$quota->season_id = $season_id;
|
|
$quota->qtype = "PLATZIERUNG";
|
|
$quota->name = "Platz 4";
|
|
$quota->order = 4;
|
|
$quota->prc = 10;
|
|
$quota->save();
|
|
|
|
$quota = new Quota;
|
|
$quota->season_id = $season_id;
|
|
$quota->qtype = "PLATZIERUNG";
|
|
$quota->name = "Platz 5";
|
|
$quota->order = 5;
|
|
$quota->prc = 9;
|
|
$quota->save();
|
|
|
|
$quota = new Quota;
|
|
$quota->season_id = $season_id;
|
|
$quota->qtype = "PLATZIERUNG";
|
|
$quota->name = "Platz 6";
|
|
$quota->order = 6;
|
|
$quota->prc = 8;
|
|
$quota->save();
|
|
|
|
$quota = new Quota;
|
|
$quota->season_id = $season_id;
|
|
$quota->qtype = "PLATZIERUNG";
|
|
$quota->name = "Platz 7";
|
|
$quota->order = 7;
|
|
$quota->prc = 7;
|
|
$quota->save();
|
|
|
|
$quota = new Quota;
|
|
$quota->season_id = $season_id;
|
|
$quota->qtype = "PLATZIERUNG";
|
|
$quota->name = "Platz 8";
|
|
$quota->order = 8;
|
|
$quota->prc = 6;
|
|
$quota->save();
|
|
|
|
$quota = new Quota;
|
|
$quota->season_id = $season_id;
|
|
$quota->qtype = "PLATZIERUNG";
|
|
$quota->name = "Platz 9";
|
|
$quota->order = 9;
|
|
$quota->prc = 5;
|
|
$quota->save();
|
|
|
|
$quota = new Quota;
|
|
$quota->season_id = $season_id;
|
|
$quota->qtype = "PLATZIERUNG";
|
|
$quota->name = "Platz 10";
|
|
$quota->order = 10;
|
|
$quota->prc = 4;
|
|
$quota->save();
|
|
}
|
|
}
|