I am facing a weired issue. I have written code for pagination. Everything is working as expected, but only conditions are not working(only certain conditions)
Here is my code for pagination.
public $paginate = array(
'limit' => 50,
'paramType' => 'querystring'
//use in action
$this->paginate['ApiLog'] = array('limit' => 50, 'order' => 'ApiLog.id DESC', 'paramType' => 'querystring');
$this->paginate['ApiLog']['conditions'] = array('ApiLog.log_type' => 2);
$this->paginate['ApiLog']['joins'] = array(
'table' => 'users',
'alias' => 'User',
'type' => 'LEFT',
'conditions' => array('User.id = ApiLog.user_id')
$this->Paginator->settings = $this->paginate['ApiLog'];
$apilogs = $this->Paginator->paginate('ApiLog');
log_type = '1'
I have fixed issue, This issue was due to
data type declared into database. In production it was
tinyint(1) and in development it given
int(1). It is saving correct value in database in both environment but in condition
tinyint(1) is working with only 0 & 1 not with 2.
I didn't understand reason behind this.