Ciao,
ho la necessità di creare un report con dei campi che prendono valori da diverse query.
Mi chiedevo se si potesse fare e quale sarebbe la implementazione esatta
Attualmente il mio codice ha:
…
…
$criteria= new CDbCriteria;
$criteria->select = "COUNT(*) as total";
$criteria->condition = "(project.prj_start_date >= ‘$current_date’) AND
(project.prj_start_date < ‘$next_date’) AND
(project.class_id=$class_id)
AND (phases.status_id='5') ";
$criteria->with ="phases.project";
$totals = Projects::model()->findall($criteria)
foreach ($totals as $tot)
$report+= $tot->total;
$this->render(‘report2’,array(‘reports’=>$report));
è possibile nella stesa funzione aggiungere una nuovo criteria ad esempio criteria2 con una nuova query e fare il render tipo:
$this->render(‘report2’,array(‘reports’=>$report,‘reports’=>$report2));
ci sono soluzioni?