Skip to content
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

[BUG]: replace part of column name in query builder started with "NOT_" prefix #14918

Closed
yurik3zzz opened this issue Mar 16, 2020 · 1 comment
Labels
bug A bug report duplicate Duplicate issue. The duplicate issue is referenced in the comments

Comments

@yurik3zzz
Copy link

I have a mysql model product with column "not_for_free_delivery"

After run query
$products = \Products::query()->where('not_for_free_delivery = 1')->execute();

Have error
Error exception: Column '_for_free_delivery' doesn't belong to any of the selected models (1), when preparing: SELECT [Products].* FROM [Products] WHERE not_for_free_delivery = 1

column named as "not_for_free_delivery" was replaced to '_for_free_delivery' in sql

phalcon version 4.0.4

@yurik3zzz yurik3zzz added bug A bug report status: unverified Unverified labels Mar 16, 2020
@niden niden added 4.1.0 duplicate Duplicate issue. The duplicate issue is referenced in the comments and removed status: unverified Unverified labels Mar 16, 2020
@niden
Copy link
Sponsor Member

niden commented Mar 16, 2020

Quick workaround would be to enclose the field with [] i.e. [not_for_delivery].

Duplicate issue: #14641

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report duplicate Duplicate issue. The duplicate issue is referenced in the comments
Projects
Archived in project
Development

No branches or pull requests

2 participants