我有以下代码
$result = $handle->select()->from('store_products_id', array('count'=>'COUNT(store_products_id.product_id)'))
->where('store_products_id.store_id=?', $this->store_id)
->columns($selectColumns)
->join('product_quickinfo', 'store_products_id.product_id =
product_quickinfo.product_id')
->join('image_paths', 'product_quickinfo.image_id =
image_paths.image_id')
->order('product_quickinfo.date_created DESC')
->limitPage($this->page_number, $this->sum_each_page)
->query(ZEND_DB::FETCH_OBJ);
但是,我只得到一个结果.. 看看 print_r:
Array ( [0] => stdClass Object ( [count] => 14 [small_path] => 1 [product_name] => v evrecvrv [price] => 22 [product_id] => 1 [image_id] => 1 [date_created] => 0000-00-00 00:00:00 [large_path] => [description] => ) )
当我移除 COUNT 控制器时,我会取回所有项目。我怎样才能既计算整个查询(超出我强加的限制)又取回整个查询?
谢谢。