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.
//declaration
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(
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');
This code is working prefect on development environment and return logs that has type 2, but in production it return only logs that has type 1. I have spent whole day to figure out issue.
If i do add any other condition in conditions array
that does take effect but not log_type
.
I print Query logs, in where clause
it always show log_type = '1'
I have cleared cache as well.
Any help appreciated, thanks.
tmp/cache
folder – Geminius