Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrebian/9597741 to your computer and use it in GitHub Desktop.
Save andrebian/9597741 to your computer and use it in GitHub Desktop.
<?php
$this->Filter->addFilters('Filtro', array('LIKE' => __('contendo', true)));
$this->Filter->setPaginate('limit', 6); // opcional
$this->Filter->setPaginate('group', 'Qname.queue');
$this->Filter->setPaginate('fields', array('COUNT(QueueStat.qname) as Total', 'Qname.queue', 'Qevent.event', 'Qevent.event_id'));
$this->Filter->setPaginate('conditions', $this->Filter->getConditions());
$this->QueueStat->recursive = 0;
$this->set('queuestats', $this->paginate());
$this->Filter->setPaginate('limit', 6);
$this->Filter->setPaginate('group', 'Qname.queue', 'Qevent.event', 'Qevent.event_id');
$this->Filter->setPaginate('fields', array('COUNT(QueueStat.qname) as Atendidas', 'Qname.queue', 'Qevent.event', 'Qevent.event_id'));
$this->Filter->setPaginate('conditions', array('Qevent.event_id = 12'));
$this->QueueStat->recursive = 0;
$this->set('eventos', $this->paginate());
?>
passando as variaveis, queuestats e eventos para usar no foreach!
e la na VIEW eu to querendo usar assim...
<table>
<?php foreach ($queuestats as $queuestat)(think)>
<?php foreach ($eventos as $evento)(think)>
<tr class="success">
<td><?php echo $queuestat['Qname']['queue']; ?></td>
<td><?php echo $queuestat[0]['Total']; ?></td>
<td><?php echo $evento[0]['Atendidas']; ?></td>
</tr>
<?php endforeach;?>
<?php endforeach;?>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment