php - How can I paginate data from a model join with different database's table in cakephp? -
i have cakephp app use 2 databases, main 1 , common 1 share information other apps. in app need paginate tbl_properties join tbl_favorite_properties . made query.
$options = array(); $options ['joins'] [] = array ('table' =>"tbl_properties", 'alias' => 'property', 'type' => 'left', 'foreignkey' => false, 'conditions' => array ('property.mls = favoriteproperty.mls_num' ) ); $conditions = array('conditions'=>array('favoriteproperty.user_id'=>$user_id)); $arrfields = array ('fields' => array ('favoriteproperty.user_id','favoriteproperty.mls_num mls','property.id','property.mls','property.house_number')); $criterias = array_merge($options,$conditions,$arrfields); $this->controller->paginate = $criterias; $favproperties = $this->controller->paginate('favoriteproperty');
the bl_properties in different db, when make join favoriteproperty model i'm getting table 'pbl_chkinst2cn.tbl_properties' doesn't exist. there different way paginate relation? thank !!!!!
Comments
Post a Comment