私の問題は次のとおりです。
コントローラーで:
$this->paginate = array('conditions' => array($cond_review),'limit' => 3); $result1 = $this->paginate('Model1');
$this->paginate = array('conditions' => array($condUser),'limit' => 2); $result2 = $this->paginate('Model2');
if($this->Session->read('tab_item') == 'visit'){
if($this->RequestHandler->isAjax())
{
$this->layout = "";
$this->render('/elements/review_detail_visit_ajax');
return;
}
}else if($this->Session->read('tab_item') == 'review'){
if($this->RequestHandler->isAjax())
{
$this->layout = "";
$this->render('/elements/friend_review_listing_ajax');
return;
}
}
モデル:
function paginate($conditions, $fields, $order, $limit, $page = 1, $recursive = null, $extra = array()) {
$cod = implode(" AND ", $conditions);
$recursive = -1;
//$group = $fields = array('week', 'away_team_id', 'home_team_id');
return $this->find('all', compact('conditions', 'fields', 'order', 'limit', 'page', 'recursive', 'group'));
}
/**
* Overridden paginateCount method
*/
function paginateCount($conditions = null, $recursive = 0, $extra = array()) {
$cod = implode(" AND ", $conditions);
$sql = "SELECT id FROM table WHERE 1=1 AND ".$cod;
$this->recursive = $recursive;
$results = mysql_query($sql);
$num = mysql_num_rows($results);
return $num ;
}
ここで私の問題は、2 つの結果配列 $result1 と $result2 のデータ数が異なることです。ただし、常に同じ数のページを返し、制限も同じです。
この問題を解決するには?