Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $select = $this->getTable()
- ->select()
- ->from(
- 'property_stats',
- array(
- 'stat_property_id',
- 'month' => 'MONTH(`stat_date`)',
- 'unique' => 'SUM(`stat_count_unique`)',
- 'returning' => 'SUM(`stat_count_returning`)'
- )
- )
- ->joinLeft(
- 'property',
- array('property_id = stat_property_id')
- )
- ->where('YEAR(`stat_date`) = YEAR(CURDATE())')
- ->group('stat_property_id')
- ->group('MONTH(`stat_date`)');
Add Comment
Please, Sign In to add comment