Closed onlysli closed 7 years ago
Please include the code you're using.
I have to filters:
//filter url
public static function url($orm, $url) {
return $orm->where_raw('( `url_rewrite` = ? ) OR ( `url_rewrite_en` = ? )', array($url, $url));
}
//filter visible
public static function visibles($orm) {
return $orm->where('trash', 0)->where('activ', 1)
->where_raw('(( DATE(`start_date`) <= ? ) AND ((`end_date` != ? AND DATE(`end_date`) >= ?) OR (`end_date` = ? OR `end_date` = \'\')))', array(date("Y-m-d"), '0000-00-00', date("Y-m-d"), '0000-00-00'));
}
and used together:
$spot = Model::factory('Spots')->filter('url', $this->principal_arguments)->filter('visibles')->find_one();
Will ignore second filter.
I also tried to use the where_row directly without filters but same effect.
Thank you.
I have written a test to verify this and I cannot replicate the issue you're having. Please see https://github.com/j4mie/idiorm/blob/develop/test/QueryBuilderTest.php#L295
If you run the test suite and still get failures please open a new ticket.
Hi, It seems that i can't use more then one where_raw in one statement. Only the first one is working, the second one is ignored.
Is there a fix for this?
Thank you!