这是我的加入查询代码:
$options['joins'] = array(
array('table' => 'employees',
'alias' => 'Employees',
'type' => 'INNER',
'foreignKey' => 'employee_id',
// 'fields' => 'Users.user', <- get rid of this
'conditions' => array(
'TravancoDSREmployee.emp_id = Employees.employee_id'
)
)
);
$options['fields'] = array('TravancoDSREmployee.*','Employees.*'); // <- insert this
$options['conditions'] = array( 'TravancoDSREmployee.created_emp_id' => $emp_id);
$result = $this->TravancoDSREmployee->find('all', $options);
$this->set('result', $result);
我想用分页设置它。
我怎样才能做到这一点?