Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 1 year ago.
0

I can barely understand what you are saying, but I believe what you need is to simply add:

->where('mt4_users.enable_readonly, '=', 0) before get().

You are doing a basic inner join, so it is already only returning rows from mt4_trades where login_name matches a value in mt4_users. Another option, if you want to retrieve all mt4_users no matter what, is to do a left join, and then in our app act on whether mt4_trades is null.

0

thanks hackel for replay but i need return all value in enable_readonly example if enable_readonly =0 active if enable_readonly =1 can be (in active) or (pending) if in active must check login_name in mt4_treades

0

I think you would get better answers from here if you can structure your question properly with the right punctuation.

Here's a little suggestion:

  1. Run your query first.

  2. Assign the value of enable_readonly to a variable

  3. Then do an IF statement on the variable. for e.g.

if($readonly == 0)
{

  //Code to execute if the value is 0

} else {

  //Code to execute if the value is 1

}

Hope this helps. I could expand on this further if you want.

0

Thanks rayeess but not the answers

0

why not?

0

rayees thank you for your answers 80% right very thanks

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.