Remove commented out code. #539

This commit is contained in:
Korina Cordero 2021-03-02 02:31:11 +00:00
parent cd48c5e032
commit 643bc61bf9

View file

@ -56,8 +56,6 @@ class GenerateCustomerSourceReportCommand extends Command
$end_date->modify('last day of this month');
$end_date->setTime(23, 59);
$str_end_date = $end_date->format('Y-m-d H:i:s');
//error_log($start_date->format('Y-m-d H:i:s'));
//error_log($str_end_date);
// get all mobile user customer id hash
$resq_cust_ids = $this->getRESQCustomerIDs();
@ -105,7 +103,6 @@ class GenerateCustomerSourceReportCommand extends Command
else
$source = 'crm / owr';
// error_log(print_r($row, true));
$data = [
$row[0], // id
$row[1], // first name
@ -127,79 +124,6 @@ class GenerateCustomerSourceReportCommand extends Command
fclose($fp);
/*
$cust_query = $em->createQuery('select c from App\Entity\Customer c
where c.date_create >= :start_date and c.date_create <= :end_date
order by c.date_create asc');
$cust_query->setParameter('start_date', $start_date)
->setParameter('end_date', $end_date);
$customer_results = $cust_query->iterate();
*/
/*
$customers = [];
foreach ($customer_results as $row)
{
$cust = $row[0];
error_log($cust->getID());
// get the ff fields: first name, last name, landline
// mobile, fax, office, email address, vehicle brand,
// vehicle model, plate number
// check if flag_confirmed == true and date_confirmed is not null
// if so, source is Resq app
// if not, source is OWR/CRM
// TODO: figure out the source
if ($cust->hasMobileApp())
$source = 'resq';
else
$source = 'crm / owr';
// NOTE: this does not eliminate duplicate vehicles
$vehicles = $cust->getVehicles();
foreach ($vehicles as $cv)
{
$v = $cv->getVehicle();
$vmfg = $v->getManufacturer();
$data = [
$cust->getID(),
$cust->getFirstName(),
$cust->getLastName(),
$cust->getPhoneMobile(),
$cust->getPhoneLandline(),
$cust->getPhoneOffice(),
$cust->getPhoneFax(),
$cust->getEmail(),
$vmfg->getName(),
$v->getMake(),
$v->getModelYearFormatted(),
$cv->getPlateNumber(),
$cv->getColor(),
$source,
];
// detach associations
// NOTE: we may need to detach vehicle manufacturer eventually
$em->detach($cv);
$em->detach($v);
$em->detach($vmfg);
fputcsv($fp, $data);
}
$em->detach($row[0]);
}
fclose($fp);
*/
return 0;
}
@ -221,7 +145,6 @@ class GenerateCustomerSourceReportCommand extends Command
$cust_ids[$cust['customer_id']] = $cust['customer_id'];
}
// error_log(print_r($cust_ids));
return $cust_ids;
}
}