...
This commit is contained in:
parent
09b75172d8
commit
64e4959884
9 changed files with 91 additions and 67 deletions
|
|
@ -114,8 +114,7 @@ class RoundsController extends Controller
|
|||
|
||||
// Validate form
|
||||
$this->validate(request(), [
|
||||
'round_id' => 'required',
|
||||
'report' => 'required'
|
||||
'round_id' => 'required'
|
||||
]);
|
||||
|
||||
$seasonId = Season::getCurrent()->id;
|
||||
|
|
@ -124,8 +123,10 @@ class RoundsController extends Controller
|
|||
|
||||
//Log::info("Report = ".request("report"));
|
||||
|
||||
|
||||
$round->report = request("report");
|
||||
$round->report="";
|
||||
if (request("report")){
|
||||
$round->report = request("report");
|
||||
}
|
||||
$round->save();
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -16,8 +16,22 @@ use Log;
|
|||
class UsersController extends Controller
|
||||
{
|
||||
public function main() {
|
||||
$roundname="";
|
||||
$report="";
|
||||
|
||||
return view('main');
|
||||
$currentSeason=Season::getCurrent();
|
||||
|
||||
if ($currentSeason) {
|
||||
$round_id = Round::getLastLockedRoundId();
|
||||
if ($round_id > -1) {
|
||||
$round = Round::where("id", "=", $round_id)->first();
|
||||
$report = $round->report;
|
||||
Log::info("Loaded report:".$report." round-id=".$round_id);
|
||||
$roundname = $round->name;
|
||||
} else { Log::info("No round identified. Last Locked=".$round_id); }
|
||||
} else {Log::info("No current season");}
|
||||
|
||||
return view('main',compact('roundname','report'));
|
||||
}
|
||||
|
||||
public function index() {
|
||||
|
|
@ -87,6 +101,8 @@ class UsersController extends Controller
|
|||
return redirect('/users');
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function ranking($round_id) {
|
||||
Log::info("Start ranking");
|
||||
|
||||
|
|
@ -166,9 +182,6 @@ class UsersController extends Controller
|
|||
if (!array_key_exists($key,$tendencies)) { $tendencies[$key]=0; }
|
||||
$tendencies[$key]+=1;
|
||||
|
||||
if ($user->id==1) {
|
||||
Log::info("Triggered tendency bonus for userid ".$user->id." gameid ".$game->id." roundid ".$round->id." tippid ".$tipp->id." tendency=". $tendencies[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
$user->totalScore += $score;
|
||||
|
|
@ -185,7 +198,7 @@ class UsersController extends Controller
|
|||
// Increase score here
|
||||
if (array_key_exists($key,$tendencies)) {
|
||||
if ($tendencies[$key] == 4) {
|
||||
Log::info("Increasing score ! userid=" . $user->id . ", gameid " . $game->id . ", roundid " . $round->id . ", tippid " . $tipp->id . ", tendency=" . $tendencies[$key]);
|
||||
//Log::info("Increasing score ! userid=" . $user->id . ", gameid " . $game->id . ", roundid " . $round->id . ", tippid " . $tipp->id . ", tendency=" . $tendencies[$key]);
|
||||
$user->totalScore += 2;
|
||||
$user->dayScore+=2;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue