SELECT `e`.*, `at_deal_start_date`.`value` AS `deal_start_date`, `at_deal_end_date`.`value` AS `deal_end_date`, `at_socko_date_ok`.`value` AS `socko_date_ok`, `at_news_from_date`.`value` AS `news_from_date`, `at_stock_status`.`stock_status` FROM `catalog_product_entity` AS `e`
INNER JOIN `catalog_product_entity_datetime` AS `at_deal_start_date` ON (`at_deal_start_date`.`entity_id` = `e`.`entity_id`) AND (`at_deal_start_date`.`attribute_id` = '145') AND (`at_deal_start_date`.`store_id` = 0)
INNER JOIN `catalog_product_entity_datetime` AS `at_deal_end_date` ON (`at_deal_end_date`.`entity_id` = `e`.`entity_id`) AND (`at_deal_end_date`.`attribute_id` = '146') AND (`at_deal_end_date`.`store_id` = 0)
INNER JOIN `catalog_product_entity_int` AS `at_socko_date_ok` ON (`at_socko_date_ok`.`entity_id` = `e`.`entity_id`) AND (`at_socko_date_ok`.`attribute_id` = '642') AND (`at_socko_date_ok`.`store_id` = 0)
LEFT JOIN `catalog_product_entity_datetime` AS `at_news_from_date` ON (`at_news_from_date`.`entity_id` = `e`.`entity_id`) AND (`at_news_from_date`.`attribute_id` = '93') AND (`at_news_from_date`.`store_id` = 0)
LEFT JOIN `cataloginventory_stock_status` AS `at_stock_status` ON (at_stock_status.`product_id`=e.entity_id) AND (at_stock_status.stock_id=1)
INNER JOIN `catalog_product_website` AS `product_website` ON product_website.product_id = e.entity_id AND product_website.website_id = 2 WHERE (at_deal_start_date.value < '2023-03-30 03:09:28') AND (at_deal_end_date.value > '2023-03-30 03:09:28') AND (at_socko_date_ok.value = '1') AND (at_stock_status.stock_status = 1) ORDER BY `news_from_date` desc
SELECT `e`.*, `at_deal_start_date`.`value` AS `deal_start_date`, `at_deal_end_date`.`value` AS `deal_end_date`, `at_socko_date_ok`.`value` AS `socko_date_ok`, `at_stock_status`.`stock_status` FROM `catalog_product_entity` AS `e`
INNER JOIN `catalog_product_entity_datetime` AS `at_deal_start_date` ON (`at_deal_start_date`.`entity_id` = `e`.`entity_id`) AND (`at_deal_start_date`.`attribute_id` = '145') AND (`at_deal_start_date`.`store_id` = 0)
INNER JOIN `catalog_product_entity_datetime` AS `at_deal_end_date` ON (`at_deal_end_date`.`entity_id` = `e`.`entity_id`) AND (`at_deal_end_date`.`attribute_id` = '146') AND (`at_deal_end_date`.`store_id` = 0)
INNER JOIN `catalog_product_entity_int` AS `at_socko_date_ok` ON (`at_socko_date_ok`.`entity_id` = `e`.`entity_id`) AND (`at_socko_date_ok`.`attribute_id` = '642') AND (`at_socko_date_ok`.`store_id` = 0)
LEFT JOIN `cataloginventory_stock_status` AS `at_stock_status` ON (at_stock_status.`product_id`=e.entity_id) AND (at_stock_status.stock_id=1)
INNER JOIN `catalog_product_website` AS `product_website` ON product_website.product_id = e.entity_id AND product_website.website_id = 2 WHERE (at_deal_start_date.value < '2023-03-30 03:09:29') AND (at_deal_end_date.value > '2023-03-30 03:09:29') AND (at_socko_date_ok.value = '1') AND (at_stock_status.stock_status = 1) ORDER BY `at_deal_end_date`.`value` desc
SELECT `e`.*, `at_status`.`value` AS `status`, `at_deal_start_date`.`value` AS `deal_start_date`, `at_deal_end_date`.`value` AS `deal_end_date`, `at_stock_status`.`stock_status`, `at_order_month`.`value` AS `order_month` FROM `catalog_product_entity` AS `e`
INNER JOIN `catalog_product_entity_int` AS `at_status` ON (`at_status`.`entity_id` = `e`.`entity_id`) AND (`at_status`.`attribute_id` = '96') AND (`at_status`.`store_id` = 0)
INNER JOIN `catalog_product_entity_datetime` AS `at_deal_start_date` ON (`at_deal_start_date`.`entity_id` = `e`.`entity_id`) AND (`at_deal_start_date`.`attribute_id` = '145') AND (`at_deal_start_date`.`store_id` = 0)
INNER JOIN `catalog_product_entity_datetime` AS `at_deal_end_date` ON (`at_deal_end_date`.`entity_id` = `e`.`entity_id`) AND (`at_deal_end_date`.`attribute_id` = '146') AND (`at_deal_end_date`.`store_id` = 0)
LEFT JOIN `cataloginventory_stock_status` AS `at_stock_status` ON (at_stock_status.`product_id`=e.entity_id) AND (at_stock_status.stock_id=1)
LEFT JOIN `catalog_product_entity_int` AS `socko_date_ok_t` ON e.entity_id=socko_date_ok_t.entity_id AND socko_date_ok_t.attribute_id='642' AND socko_date_ok_t.store_id='0'
LEFT JOIN `catalog_product_entity_decimal` AS `at_order_month` ON (`at_order_month`.`entity_id` = `e`.`entity_id`) AND (`at_order_month`.`attribute_id` = '204') AND (`at_order_month`.`store_id` = 0)
INNER JOIN `catalog_product_website` AS `product_website` ON product_website.product_id = e.entity_id AND product_website.website_id = 2 WHERE (at_status.value = '1') AND (at_deal_start_date.value < '2023-03-30 15:09:29') AND (at_deal_end_date.value >= '2023-03-30 00:00:00') AND (at_status.value = '1') AND (at_stock_status.stock_status = 1) ORDER BY `socko_date_ok_t`.`value` desc, `order_month` desc, `e`.`created_at` desc
SELECT `e`.*, `at_deal_start_date`.`value` AS `deal_start_date`, `at_deal_end_date`.`value` AS `deal_end_date`, `at_socko_date_ok`.`value` AS `socko_date_ok`, `at_stock_status`.`stock_status` FROM `catalog_product_entity` AS `e`
INNER JOIN `catalog_product_entity_datetime` AS `at_deal_start_date` ON (`at_deal_start_date`.`entity_id` = `e`.`entity_id`) AND (`at_deal_start_date`.`attribute_id` = '145') AND (`at_deal_start_date`.`store_id` = 0)
INNER JOIN `catalog_product_entity_datetime` AS `at_deal_end_date` ON (`at_deal_end_date`.`entity_id` = `e`.`entity_id`) AND (`at_deal_end_date`.`attribute_id` = '146') AND (`at_deal_end_date`.`store_id` = 0)
INNER JOIN `catalog_product_entity_int` AS `at_socko_date_ok` ON (`at_socko_date_ok`.`entity_id` = `e`.`entity_id`) AND (`at_socko_date_ok`.`attribute_id` = '642') AND (`at_socko_date_ok`.`store_id` = 0)
LEFT JOIN `cataloginventory_stock_status` AS `at_stock_status` ON (at_stock_status.`product_id`=e.entity_id) AND (at_stock_status.stock_id=1)
INNER JOIN `catalog_product_website` AS `product_website` ON product_website.product_id = e.entity_id AND product_website.website_id = 2 WHERE (at_deal_start_date.value < '2023-03-30 03:09:29') AND (at_deal_end_date.value > '2023-03-30 03:09:29') AND (at_socko_date_ok.value = '1') AND (e.entity_id IN((SELECT `cat`.`product_id` FROM `catalog_category_product` AS `cat` WHERE (cat.category_id IN('535'))))) AND (at_stock_status.stock_status = 1)