Fix dashboard bug for active riders not in the database #270

This commit is contained in:
Kendrick Chan 2020-01-28 05:53:52 +08:00
parent 86b4601bb8
commit 9563bd8cb2

View file

@ -50,6 +50,12 @@ class HomeController extends Controller
foreach ($riders as $rider_id => $rider_data)
{
$rider = $em->getRepository(Rider::class)->find($rider_id);
if ($rider == null)
{
unset $riders[$rider_id];
continue;
}
$jo = $rider->getActiveJobOrder();
if ($jo == null)
$riders[$rider_id]['has_jo'] = false;