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()
|
||||
->getResult();
|
||||
|
||||
$classifications = CustomerClassification::getCollection();
|
||||
|
||||
// process rows
|
||||
$rows = [];
|
||||
foreach ($obj_rows as $orow) {
|
||||
$classifications = CustomerClassification::getCollection();
|
||||
|
||||
// add row data
|
||||
$row['id'] = $orow->getID();
|
||||
$row['first_name'] = $orow->getFirstName();
|
||||
|
|
|
|||
|
|
@ -83,6 +83,9 @@ class TicketController extends BaseController
|
|||
->getQuery()
|
||||
->getResult();
|
||||
|
||||
$ticket_statuses = TicketStatus::getCollection();
|
||||
$ticket_types = TicketType::getCollection();
|
||||
|
||||
// process rows
|
||||
$rows = [];
|
||||
foreach ($obj_rows as $orow) {
|
||||
|
|
@ -93,8 +96,8 @@ class TicketController extends BaseController
|
|||
$row['first_name'] = $orow->getFirstName();
|
||||
$row['last_name'] = $orow->getLastName();
|
||||
$row['contact_num'] = $orow->getContactNumber();
|
||||
$row['status'] = $orow->getStatusText();
|
||||
$row['ticket_type'] = $orow->getTicketTypeText();
|
||||
$row['status'] = $ticket_statuses[$orow->getStatus()];
|
||||
$row['ticket_type'] = $ticket_types[$orow->getTicketType()];
|
||||
|
||||
// add row metadata
|
||||
$row['meta'] = [
|
||||
|
|
|
|||
Loading…
Reference in a new issue