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.
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
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:
Run your query first.
Assign the value of enable_readonly to a variable
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.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community