select `categories`.*, (selectcount(*) from `products` where `categories`.`slug` = `products`.`category_id`) as `items_categori_count` from `categories` where `status` ='1'and `type` ='1'
select `categories`.*, (selectcount(*) from `products` where `categories`.`slug` = `products`.`category_id`) as `items_categori_count` from `categories` where `status` ='1'and `type` ='2'
select `products`.*, `product_accessories`.`product_id` as `pivot_product_id`, `product_accessories`.`accessory_id` as `pivot_accessory_id` from `products` innerjoin `product_accessories` on `products`.`id` = `product_accessories`.`accessory_id` where `product_accessories`.`product_id` in (1835)