Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $this->PollingText->Behaviors->load('Containable', array('autoFields' => false));
- $pollings = $this->PollingText->find('all', array(
- 'conditions' => array('PollingText.polling_category_id' => $category_id),
- 'order' => array('PollingText.order_number' => 'ASC'),
- 'contain' => array(
- 'PollingQuestion',
- 'PollingQuestion.PollingAnswer',
- 'PollingQuestion.PollingAnswer.Respondent' => array(
- 'conditions' => array(
- 'Respondent.created BETWEEN ? AND ?' => array(
- $startDate->format('Y-m-d'),
- $endDate->format('Y-m-d')
- ),
- ),
- 'group' => array('Respondent.created'),
- 'fields' => array(
- 'COUNT(Respondent.id) AS total_respondent',
- 'Respondent.created'
- )
- ),
- ),
- ));
Advertisement
Add Comment
Please, Sign In to add comment