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

Cannot use multi where in first_where method #804

Open
LordDeveloper opened this issue Oct 12, 2022 · 2 comments
Open

Cannot use multi where in first_where method #804

LordDeveloper opened this issue Oct 12, 2022 · 2 comments
Labels
enhancement A feature that exists, works as intended but needs to be improved feature request A feature that does not yet exist but will be a good addition to the library

Comments

@LordDeveloper
Copy link
Contributor

Hey, This is my code:

payment = Payment.first_where({
    'transaction_id': req.get('trans_id'),
    'order_id': req.get('order_id')
})

Error:
masoniteorm.exceptions.QueryException: (1054, "Unknown column 'payments.{'transaction_id': 'ff9db407-b55c-494b-a8af-a1944cedab0a', 'id': '1'}' in 'where clause'")

@LordDeveloper LordDeveloper added enhancement A feature that exists, works as intended but needs to be improved feature request A feature that does not yet exist but will be a good addition to the library labels Oct 12, 2022
@Marlysson
Copy link
Contributor

Until solve this, could you try this:

Model.where(field1, value1).where(field2, value2).first()

?

@LordDeveloper
Copy link
Contributor Author

Referenc

Hi, Yes this is working correctly.

@josephmancuso josephmancuso changed the title Allow to use multi where in first_where method Cannot to use multi where in first_where method Oct 6, 2023
@josephmancuso josephmancuso changed the title Cannot to use multi where in first_where method Cannot use multi where in first_where method Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A feature that exists, works as intended but needs to be improved feature request A feature that does not yet exist but will be a good addition to the library
Projects
None yet
Development

No branches or pull requests

2 participants