Working on gshirt payout

This commit is contained in:
Torsten Schneider 2017-12-29 19:08:46 +01:00
parent 16231357b4
commit 9126d54dfb
10 changed files with 507 additions and 108 deletions

View file

@ -9,8 +9,13 @@ class Test extends Model
{
// In order for testing seasons to work, we need a way to set all the users to 'paid'
// this method is used by fillSeason method
public static function paySeason($seasonId)
public static function paySeason($seasonId=-1)
{
if ($seasonId==-1) {
$season = Season::getCurrent();
$seasonId = $season->id;
}
$users = User::all();
$cnt=0;
foreach ($users as $user) {
@ -22,16 +27,19 @@ class Test extends Model
}
public static function fillSeason($seasonId=-1) {
if ($seasonId==-1) {
$season = Season::getCurrent();
$seasonId = $season->id;
}
error_log("creating all tipps started");
Tipp::createAllTips();
error_log("creating all tipps completed");
$users = User::all();
if ($seasonId==-1) {
$season = Season::getCurrent();
$seasonId = $season->id;
}
error_log("setting payment started");
Test::paySeason($seasonId);