-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More then one where_raw #236
Comments
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!
The text was updated successfully, but these errors were encountered: