Modify query for customer vehicle to get only one customer vehicle. #255

This commit is contained in:
Korina Cordero 2019-08-22 06:47:33 +00:00
parent 15f2764ae8
commit b4c8b83742

View file

@ -510,7 +510,8 @@ class ReportController extends Controller
while(($fields = fgetcsv($fh)) !== false)
{
$has_warranty = false;
if ($row_num <= 2)
//error_log($row_num . ' ' . trim($fields[2]));
if ($row_num < 1)
{
$row_num++;
continue;
@ -535,8 +536,8 @@ class ReportController extends Controller
{
// get customer vehicle using plate number
$em = $this->getDoctrine()->getManager();
$cust_vehicles = $em->getRepository(CustomerVehicle::class)->findBy(['plate_number' => $warranty->getPlateNumber()]);
foreach ($cust_vehicles as $cv)
$cv = $em->getRepository(CustomerVehicle::class)->findOneBy(['plate_number' => $warranty->getPlateNumber()]);
if ($cv != null)
{
// get customer info
// get mobile session of customer