make Charts on dashboard work

This commit is contained in:
githubertus 2018-04-24 20:34:03 +02:00 committed by GitHub
parent 0bfe124514
commit f50d708b7a
1 changed files with 3 additions and 3 deletions

View File

@ -48,7 +48,7 @@ class EventStats extends \Illuminate\Database\Eloquent\Model
*/
public function updateViewCount($event_id)
{
$stats = $this->firstOrNew([
$stats = $this->updateOrCreate([
'event_id' => $event_id,
'date' => DB::raw('CURRENT_DATE'),
]);
@ -72,7 +72,7 @@ class EventStats extends \Illuminate\Database\Eloquent\Model
*/
public function updateSalesVolume($event_id)
{
$stats = $this->firstOrNew([
$stats = $this->updateOrCreate([
'event_id' => $event_id,
'date' => DB::raw('CURRENT_DATE'),
]);
@ -92,7 +92,7 @@ class EventStats extends \Illuminate\Database\Eloquent\Model
*/
public function updateTicketsSoldCount($event_id, $count)
{
$stats = $this->firstOrNew([
$stats = $this->updateOrCreate([
'event_id' => $event_id,
'date' => DB::raw('CURRENT_DATE'),
]);