Move getting collection data outside of loops
This commit is contained in:
parent
6ea7f294c3
commit
8a2e75f999
2 changed files with 7 additions and 4 deletions
|
|
@ -101,11 +101,11 @@ class CustomerController extends BaseController
|
||||||
->getQuery()
|
->getQuery()
|
||||||
->getResult();
|
->getResult();
|
||||||
|
|
||||||
|
$classifications = CustomerClassification::getCollection();
|
||||||
|
|
||||||
// process rows
|
// process rows
|
||||||
$rows = [];
|
$rows = [];
|
||||||
foreach ($obj_rows as $orow) {
|
foreach ($obj_rows as $orow) {
|
||||||
$classifications = CustomerClassification::getCollection();
|
|
||||||
|
|
||||||
// add row data
|
// add row data
|
||||||
$row['id'] = $orow->getID();
|
$row['id'] = $orow->getID();
|
||||||
$row['first_name'] = $orow->getFirstName();
|
$row['first_name'] = $orow->getFirstName();
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,9 @@ class TicketController extends BaseController
|
||||||
->getQuery()
|
->getQuery()
|
||||||
->getResult();
|
->getResult();
|
||||||
|
|
||||||
|
$ticket_statuses = TicketStatus::getCollection();
|
||||||
|
$ticket_types = TicketType::getCollection();
|
||||||
|
|
||||||
// process rows
|
// process rows
|
||||||
$rows = [];
|
$rows = [];
|
||||||
foreach ($obj_rows as $orow) {
|
foreach ($obj_rows as $orow) {
|
||||||
|
|
@ -93,8 +96,8 @@ class TicketController extends BaseController
|
||||||
$row['first_name'] = $orow->getFirstName();
|
$row['first_name'] = $orow->getFirstName();
|
||||||
$row['last_name'] = $orow->getLastName();
|
$row['last_name'] = $orow->getLastName();
|
||||||
$row['contact_num'] = $orow->getContactNumber();
|
$row['contact_num'] = $orow->getContactNumber();
|
||||||
$row['status'] = $orow->getStatusText();
|
$row['status'] = $ticket_statuses[$orow->getStatus()];
|
||||||
$row['ticket_type'] = $orow->getTicketTypeText();
|
$row['ticket_type'] = $ticket_types[$orow->getTicketType()];
|
||||||
|
|
||||||
// add row metadata
|
// add row metadata
|
||||||
$row['meta'] = [
|
$row['meta'] = [
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue