$query = DB::select(array('COUNT("cs_product.id")', 'total_posts'))
->from('cs_product')
->join('cs_content_list')
->on('cs_product.cat_id', '=', 'cs_content_list.content_id')
->and_where('cs_content_list.url', '=', $parent)
;
$result = $query->execute()->get('total_posts');
return $result;
Вроде раньше, что-то подобное работало. Сейчас кохана генерирует такой запрос
SELECT `COUNT("cs_product`.`id")` AS `total_posts` FROM `cs_product` JOIN `cs_content_list` ON (`cs_product`.`cat_id` = `cs_content_list`.`content_id`) WHERE `cs_content_list`.`url` = 'Computers_and_accessories'
соответственно выводя такую ошибку
Unknown column 'COUNT("cs_product.id")' in 'field list'
Как написать правильно. В дкументации так написано.
http://kohanaframework.org/3.0/guide/datab...abase-functions