Fix issue where user stats aren't incremented on PIREP auto accept (#335)

* Fix issue where user stats aren't incremented on PIREP auto accept

* Formatting
This commit is contained in:
Nabeel S
2019-08-01 15:23:59 -04:00
committed by GitHub
parent 63485d5a0f
commit 95147e31bf
9 changed files with 79 additions and 18 deletions

View File

@@ -325,6 +325,9 @@ class UserService extends Service
'state' => PirepState::ACCEPTED,
];
$flight_count = Pirep::where($w)->count();
$user->flights = $flight_count;
$flight_time = Pirep::where($w)->sum('flight_time');
$user->flight_time = $flight_time;