Please refer to the collection object data as attached. My code is as below:
$products = $searchResultQuery->with(['child','combovariant','thumbnail'])->where('view',1)->get();
now the condition I intend to achieve is when list_price is less than cost_price then $products should contain only records that meet the condition. Otherwise when list_price is equal to cost_price then $products should only contain records that meet the condition.
Now when you look at the collection object data you would see that combovariant has one or many onevariant. Each onevariant has list_price and cost_price. Now you are required to sum up the list_price and cost_price for each onevariant into a total list_price and cost_price. Then do the comparison based on the suggested condition and decide which record should be in $products. Example:
$q->whereColumn('list_price',($filter) ? '<' : '=', 'cost_price');
Hello hiring member i am bhavika i have 4+years experience in php , laravel ,ajax , jquery , javascript , html , css , bootstrap , i have done many project so please give me chance to serve you thanks in advance . have a nice day :)
Hello,
I'm Ankit
I'm interesting your project very well I'm good in Website Design, HTHML, CSS , JAVASCRIT, JQUERY, AJAX, PHP and mysql expert.
I’m quite well experienced in these jobs.
Let's go ahead with me I want to service for you continuously.
Thanks
Looking forward to discuss with you.
Regards
Hello,
I Have Read your Requirement.
I have expert in Laravel.
I have experience in 6+ Year in developing.
It's glad for us to work with you.
Thanks
Girish Vadher
Hello Sir/Madam,
I have a Master's degree in computer application and 2 years of experience in Laravel MVC and MySQL. I am glad to help you with your project. will give you full support and availability for your project.
Regards,
Vaibhav Kokane.