Using Where clause for Two Tables

Posted 5 months ago by mlazuardy

i want to use some simple search to find repairs table and sales table, where it_repair_tables and it_sales_table have same field/column called "is_custom", so i joined the table to search repairs and sales. But, the problem is i want to display repairs and sales table when i search the "is_custom" column like "product" , where product is in repairs and tables.

my current code is like this

$ticket = $ticket->where('it_sale_details.is_custom',$data['sale_custom'])
                             ->where('it_repair_details.is_custom',$data['sale_custom']);

the $ticket variable have relationship with sales and repairs, but it just display the sale_details only. isn't including repair. how to fix this ? sorry very bad english :)

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.