selectcount(*) as aggregate from `products` where (exists (select*from `brands` where `products`.`brand_id` = `brands`.`id` and (`status` =1)) and (`status` =1) and (`request_status` =1) or (`brand_id` isnulland `status` =1)) and (exists (select*from `sellers` where `products`.`user_id` = `sellers`.`id` and (`status` ='approved')) or ((`added_by` ='admin'and `status` =1))) and `product_type` in ('digital', 'physical')
select*from `products` where (exists (select*from `brands` where `products`.`brand_id` = `brands`.`id` and (`status` =1)) and (`status` =1) and (`request_status` =1) or (`brand_id` isnulland `status` =1)) and (exists (select*from `sellers` where `products`.`user_id` = `sellers`.`id` and (`status` ='approved')) or ((`added_by` ='admin'and `status` =1))) and `product_type` in ('digital', 'physical') orderby `created_at` desc limit 20offset40
select `brands`.*, (selectcount(*) from `products` where `brands`.`id` = `products`.`brand_id` and (exists (select*from `brands` where `products`.`brand_id` = `brands`.`id` and (`status` =1)) and (`status` =1) and (`request_status` =1) or (`brand_id` isnulland `status` =1)) and (exists (select*from `sellers` where `products`.`user_id` = `sellers`.`id` and (`status` ='approved')) or ((`added_by` ='admin'and `status` =1))) and `product_type` in ('digital', 'physical')) as `brand_products_count` from `brands` where `status` =1orderby `created_at` desc
select*from `translations` where `translations`.`translationable_id` in (1, 2, 6, 8, 15) and `translations`.`translationable_type` ='App\Models\Category'and `locale` ='en'
select `brands`.*, (selectcount(*) from `products` where `brands`.`id` = `products`.`brand_id` and (exists (select*from `brands` where `products`.`brand_id` = `brands`.`id` and (`status` =1)) and (`status` =1) and (`request_status` =1) or (`brand_id` isnulland `status` =1)) and (exists (select*from `sellers` where `products`.`user_id` = `sellers`.`id` and (`status` ='approved')) or ((`added_by` ='admin'and `status` =1))) and `product_type` in ('digital', 'physical')) as `brand_products_count` from `brands` where `status` =1orderby `created_at` desc
selectcount(*) as aggregate from `products` where (exists (select*from `brands` where `products`.`brand_id` = `brands`.`id` and (`status` =1)) and (`status` =1) and (`request_status` =1) or (`brand_id` isnulland `status` =1)) and (exists (select*from `sellers` where `products`.`user_id` = `sellers`.`id` and (`status` ='approved')) or ((`added_by` ='admin'and `status` =1))) and `product_type` in ('digital', 'physical') and `discount` !=0