Get the oldest mobile session of customer. #252
This commit is contained in:
parent
832e88b61c
commit
33db797ca6
1 changed files with 5 additions and 4 deletions
|
|
@ -544,13 +544,14 @@ class ReportController extends Controller
|
||||||
$has_mobile = false;
|
$has_mobile = false;
|
||||||
$mobile_date = '';
|
$mobile_date = '';
|
||||||
$mobile_number = '';
|
$mobile_number = '';
|
||||||
$mobile_session = $em->getRepository(MobileSession::class)->findBy(['customer' => $cv->getCustomer()->getID()]);
|
$mobile_session = $em->getRepository(MobileSession::class)
|
||||||
foreach ($mobile_session as $mobile)
|
->findOneBy(['customer' => $cv->getCustomer()->getID()], ['date_generated' => 'ASC']);
|
||||||
|
if ($mobile_session != null)
|
||||||
{
|
{
|
||||||
// get mobile data
|
// get mobile data
|
||||||
$has_mobile = true;
|
$has_mobile = true;
|
||||||
$mobile_date = $mobile->getDateGenerated()->format("d M Y");
|
$mobile_date = $mobile_session->getDateGenerated()->format("d M Y");
|
||||||
$mobile_number = $mobile->getPhoneNumber();
|
$mobile_number = $mobile_session->getPhoneNumber();
|
||||||
}
|
}
|
||||||
$has_warranty = true;
|
$has_warranty = true;
|
||||||
$results[] = [
|
$results[] = [
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue