Skip to content
Advertisement

Model not returning value when one field used in select

I have a question with my if statement. I want to get check what is bigger than another price value. one value is saved in my database table and another one is getting with input value. but I wrote some if statement it isn’t working.

this is my table stored price column structure.

and I got another value using request

my controller function like this

can anyone help me to fix this error?

Advertisement

Answer

Your $checkRestPayment is a Model object. In order to compare the field, you need to reference the rest_payment attribute:

What you could also do is let the database do the comparison for you:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement