Mam 2 problemy
1. Jak zrobić group by date ?
2. jak wyświetlić count ??
Mam tak:
public function applet($conf, & $opts) {
$opts['go'] = false;
$rb = $this->init_module('Utils/RecordBrowser','phonecall','phonecall');
$me = CRM_ContactsCommon::get_my_record();
if ($me['id']==-1) {
CRM_ContactsCommon::no_contact_message();
return;
}
//var_dump($conf);
$crits = array('employees'=>array($me['id']), '!status'=>array(2,3));
$conds = array(
array( array('field'=>'Data', 'width'=>20),
array('field'=>'Ilosc', 'width'=>20)
),
$crits,
array('status'=>'ASC','date_and_time'=>'ASC','priority'=>'DESC'),
array('CRM_PhoneCallCommon','applet_info_format'),
15,
$conf,
& $opts
);
$date = $this->get_module_variable('applet_date',date('Y-m-d H:i:s'));
$this->display_module($rb, $conds, 'mini_view');
}
I w $conds w definicji pól z bazy tam gdzie Data i ilość chciałbym wstawić by te pola były brane z
date_format(date_and_time, '%Y-%m-%d') as 'Data', COUNT(id) as 'Ilosc'
tylko nie za bardzo widzę jak to zrobić ?