Fixed duplicate row entries and other paginate issues. The fix might be a hack, but it works for now.
git-svn-id: file:///svn-source/pmgr/branches/initial_20090526@23 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -13,17 +13,24 @@ class ContactsController extends AppController {
|
||||
|
||||
function current() {
|
||||
$this->Contact->recursive = 0;
|
||||
$this->set('contacts', $this->paginate(array('Lease.closed_date IS NULL',
|
||||
//'Contact.'
|
||||
)));
|
||||
$this->Contact->bindModel(array('hasOne' => array('ContactsLease',
|
||||
'Lease' => array(
|
||||
'foreignKey' => false,
|
||||
'conditions' => array('Lease.id = ContactsLease.lease_id')
|
||||
))),
|
||||
false);
|
||||
|
||||
$this->set('contacts', $this->paginate(array('Lease.close_date IS NULL',
|
||||
'ContactsLease.type != "ALTERNATE"')));
|
||||
$this->render('index');
|
||||
}
|
||||
|
||||
function all() {
|
||||
$this->Contact->recursive = 2;
|
||||
|
||||
//$contacts = $this->paginate();
|
||||
$this->set('contacts', $this->paginate());
|
||||
$this->Contact->recursive = 0;
|
||||
$this->Contact->bindModel(array('hasOne' => array('ContactsLease')),
|
||||
false);
|
||||
|
||||
$this->set('contacts', $this->paginate(array('ContactsLease.type != "ALTERNATE"')));
|
||||
$this->render('index');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user