-
Главная
-
Спортивная одежда для мужчин
SELECT i.*,
IF(i.catid IN (31,32,33),'1',IF(i.catid IN (35),'2',IF(i.catid IN (36,40),'3',
IF(i.catid IN (52,65,64),'4',IF(i.catid IN (34,38,63),'5',IF(i.catid IN(44,45,67),'6',
IF(i.catid IN(50,54),'7',IF(i.catid IN(53),'8','9')))))))) AS catalog_order,
IF(CHAR_LENGTH(i.size_range)=CHAR_LENGTH(i.sizes) OR CHAR_LENGTH(i.size_range)=CHAR_LENGTH(i.sizes) -1,'1','2') AS fullrange,
coll.filter_value as collection_name, st.text AS saletext, st.amount AS saleamount, IF(i.sizes != '',1,0) AS `available`, i.price_retail * ( 100 - IFNULL(i.discount, 0) )/100 AS realprice, c.name as categoryname,c.id as categoryid, c.alias as categoryalias, c.params as categoryparams, c.retail AS for_retail FROM jos_k2_items as i RIGHT JOIN jos_k2_categories AS c ON c.id = i.catid LEFT JOIN jos_sales_types AS st ON i.active_sale = st.name LEFT JOIN jos_filters AS coll ON i.collection_id = coll.id WHERE i.published = 1 AND i.sizes != '' AND i.size_range !='' AND i.access IN(1,1,5) AND i.trash = 0 AND c.published = 1 AND c.access IN(1,1,5) AND c.trash = 0 AND ( i.publish_up = '0000-00-00 00:00:00' OR i.publish_up <= '2024-09-06 03:44:01' ) AND ( i.publish_down = '0000-00-00 00:00:00' OR i.publish_down >= '2024-09-06 03:44:01' ) AND c.id IN (28,31,34,35,36,37,44,50,52,68,84) AND ( (i.`color_id` LIKE '%,27,%' OR i.`color_id` = 27) OR (i.`color_id` LIKE '%,34,%' OR i.`color_id` = 34) ) AND ( (i.`style_id` LIKE '%,59,%' OR i.`style_id` = 59) OR (i.`style_id` LIKE '%,61,%' OR i.`style_id` = 61) ) AND ( i.tm='Red-n-Rock\'s') AND ( i.sizes LIKE '%46%' OR i.sizes LIKE '%50%' OR i.sizes LIKE '%52%' ) AND i.material IN (5,25,26,7,8,9,10,11,20,23,24,28,29) ORDER BY coll.ordering DESC, `available` DESC, `sketch` ASC, catalog_order ASC, fullrange, CHAR_LENGTH(i.sizes) DESC, `newopt` DESC, i.hits DESC, i.id DESC
SELECT i.*,
IF(i.catid IN (31,32,33),'1',IF(i.catid IN (35),'2',IF(i.catid IN (36,40),'3',
IF(i.catid IN (52,65,64),'4',IF(i.catid IN (34,38,63),'5',IF(i.catid IN(44,45,67),'6',
IF(i.catid IN(50,54),'7',IF(i.catid IN(53),'8','9')))))))) AS catalog_order,
IF(CHAR_LENGTH(i.size_range)=CHAR_LENGTH(i.sizes) OR CHAR_LENGTH(i.size_range)=CHAR_LENGTH(i.sizes) -1,'1','2') AS fullrange,
coll.filter_value as collection_name, st.text AS saletext, st.amount AS saleamount, IF(i.sizes != '',1,0) AS `available`, i.price_retail * ( 100 - IFNULL(i.discount, 0) )/100 AS realprice, c.name as categoryname,c.id as categoryid, c.alias as categoryalias, c.params as categoryparams, c.retail AS for_retail FROM jos_k2_items as i RIGHT JOIN jos_k2_categories AS c ON c.id = i.catid LEFT JOIN jos_sales_types AS st ON i.active_sale = st.name LEFT JOIN jos_filters AS coll ON i.collection_id = coll.id WHERE i.published = 1 AND i.sizes != '' AND i.size_range !='' AND i.access IN(1,1,5) AND i.trash = 0 AND c.published = 1 AND c.access IN(1,1,5) AND c.trash = 0 AND ( i.publish_up = '0000-00-00 00:00:00' OR i.publish_up <= '2024-09-06 03:44:01' ) AND ( i.publish_down = '0000-00-00 00:00:00' OR i.publish_down >= '2024-09-06 03:44:01' ) AND c.id IN (28,31,34,35,36,37,44,50,52,68,84) AND ( i.`collection_id` = 44 OR i.`collection_id` = 45 OR i.`collection_id` = 48 OR i.`collection_id` = 63) AND ( (i.`color_id` LIKE '%,27,%' OR i.`color_id` = 27) OR (i.`color_id` LIKE '%,34,%' OR i.`color_id` = 34) ) AND ( (i.`style_id` LIKE '%,59,%' OR i.`style_id` = 59) OR (i.`style_id` LIKE '%,61,%' OR i.`style_id` = 61) ) AND ( i.tm='Red-n-Rock\'s') AND ( i.sizes LIKE '%46%' OR i.sizes LIKE '%50%' OR i.sizes LIKE '%52%' ) AND i.material IN (5,25,26,7,8,9,10,11,20,23,24,28,29) ORDER BY coll.ordering DESC, `available` DESC, `sketch` ASC, catalog_order ASC, fullrange, CHAR_LENGTH(i.sizes) DESC, `newopt` DESC, i.hits DESC, i.id DESC
SELECT i.*,
IF(i.catid IN (31,32,33),'1',IF(i.catid IN (35),'2',IF(i.catid IN (36,40),'3',
IF(i.catid IN (52,65,64),'4',IF(i.catid IN (34,38,63),'5',IF(i.catid IN(44,45,67),'6',
IF(i.catid IN(50,54),'7',IF(i.catid IN(53),'8','9')))))))) AS catalog_order,
IF(CHAR_LENGTH(i.size_range)=CHAR_LENGTH(i.sizes) OR CHAR_LENGTH(i.size_range)=CHAR_LENGTH(i.sizes) -1,'1','2') AS fullrange,
coll.filter_value as collection_name, st.text AS saletext, st.amount AS saleamount, IF(i.sizes != '',1,0) AS `available`, i.price_retail * ( 100 - IFNULL(i.discount, 0) )/100 AS realprice, c.name as categoryname,c.id as categoryid, c.alias as categoryalias, c.params as categoryparams, c.retail AS for_retail FROM jos_k2_items as i RIGHT JOIN jos_k2_categories AS c ON c.id = i.catid LEFT JOIN jos_sales_types AS st ON i.active_sale = st.name LEFT JOIN jos_filters AS coll ON i.collection_id = coll.id WHERE i.published = 1 AND i.sizes != '' AND i.size_range !='' AND i.access IN(1,1,5) AND i.trash = 0 AND c.published = 1 AND c.access IN(1,1,5) AND c.trash = 0 AND ( i.publish_up = '0000-00-00 00:00:00' OR i.publish_up <= '2024-09-06 03:44:01' ) AND ( i.publish_down = '0000-00-00 00:00:00' OR i.publish_down >= '2024-09-06 03:44:01' ) AND c.id IN (28,31,34,35,36,37,44,50,52,68,84) AND ( i.`collection_id` = 44 OR i.`collection_id` = 45 OR i.`collection_id` = 48 OR i.`collection_id` = 63) AND ( (i.`style_id` LIKE '%,59,%' OR i.`style_id` = 59) OR (i.`style_id` LIKE '%,61,%' OR i.`style_id` = 61) ) AND ( i.tm='Red-n-Rock\'s') AND ( i.sizes LIKE '%46%' OR i.sizes LIKE '%50%' OR i.sizes LIKE '%52%' ) AND i.material IN (5,25,26,7,8,9,10,11,20,23,24,28,29) ORDER BY coll.ordering DESC, `available` DESC, `sketch` ASC, catalog_order ASC, fullrange, CHAR_LENGTH(i.sizes) DESC, `newopt` DESC, i.hits DESC, i.id DESC
SELECT i.*,
IF(i.catid IN (31,32,33),'1',IF(i.catid IN (35),'2',IF(i.catid IN (36,40),'3',
IF(i.catid IN (52,65,64),'4',IF(i.catid IN (34,38,63),'5',IF(i.catid IN(44,45,67),'6',
IF(i.catid IN(50,54),'7',IF(i.catid IN(53),'8','9')))))))) AS catalog_order,
IF(CHAR_LENGTH(i.size_range)=CHAR_LENGTH(i.sizes) OR CHAR_LENGTH(i.size_range)=CHAR_LENGTH(i.sizes) -1,'1','2') AS fullrange,
coll.filter_value as collection_name, st.text AS saletext, st.amount AS saleamount, IF(i.sizes != '',1,0) AS `available`, i.price_retail * ( 100 - IFNULL(i.discount, 0) )/100 AS realprice, c.name as categoryname,c.id as categoryid, c.alias as categoryalias, c.params as categoryparams, c.retail AS for_retail FROM jos_k2_items as i RIGHT JOIN jos_k2_categories AS c ON c.id = i.catid LEFT JOIN jos_sales_types AS st ON i.active_sale = st.name LEFT JOIN jos_filters AS coll ON i.collection_id = coll.id WHERE i.published = 1 AND i.sizes != '' AND i.size_range !='' AND i.access IN(1,1,5) AND i.trash = 0 AND c.published = 1 AND c.access IN(1,1,5) AND c.trash = 0 AND ( i.publish_up = '0000-00-00 00:00:00' OR i.publish_up <= '2024-09-06 03:44:01' ) AND ( i.publish_down = '0000-00-00 00:00:00' OR i.publish_down >= '2024-09-06 03:44:01' ) AND c.id IN (28,31,34,35,36,37,44,50,52,68,84) AND ( i.`collection_id` = 44 OR i.`collection_id` = 45 OR i.`collection_id` = 48 OR i.`collection_id` = 63) AND ( (i.`color_id` LIKE '%,27,%' OR i.`color_id` = 27) OR (i.`color_id` LIKE '%,34,%' OR i.`color_id` = 34) ) AND ( (i.`style_id` LIKE '%,59,%' OR i.`style_id` = 59) OR (i.`style_id` LIKE '%,61,%' OR i.`style_id` = 61) ) AND ( i.tm='Red-n-Rock\'s') AND ( i.sizes LIKE '%46%' OR i.sizes LIKE '%50%' OR i.sizes LIKE '%52%' ) AND i.material IN (5,25,26,7,8,9,10,11,20,23,24,28,29) ORDER BY coll.ordering DESC, `available` DESC, `sketch` ASC, catalog_order ASC, fullrange, CHAR_LENGTH(i.sizes) DESC, `newopt` DESC, i.hits DESC, i.id DESC
SELECT i.*,
IF(i.catid IN (31,32,33),'1',IF(i.catid IN (35),'2',IF(i.catid IN (36,40),'3',
IF(i.catid IN (52,65,64),'4',IF(i.catid IN (34,38,63),'5',IF(i.catid IN(44,45,67),'6',
IF(i.catid IN(50,54),'7',IF(i.catid IN(53),'8','9')))))))) AS catalog_order,
IF(CHAR_LENGTH(i.size_range)=CHAR_LENGTH(i.sizes) OR CHAR_LENGTH(i.size_range)=CHAR_LENGTH(i.sizes) -1,'1','2') AS fullrange,
coll.filter_value as collection_name, st.text AS saletext, st.amount AS saleamount, IF(i.sizes != '',1,0) AS `available`, i.price_retail * ( 100 - IFNULL(i.discount, 0) )/100 AS realprice, c.name as categoryname,c.id as categoryid, c.alias as categoryalias, c.params as categoryparams, c.retail AS for_retail FROM jos_k2_items as i RIGHT JOIN jos_k2_categories AS c ON c.id = i.catid LEFT JOIN jos_sales_types AS st ON i.active_sale = st.name LEFT JOIN jos_filters AS coll ON i.collection_id = coll.id WHERE i.published = 1 AND i.sizes != '' AND i.size_range !='' AND i.access IN(1,1,5) AND i.trash = 0 AND c.published = 1 AND c.access IN(1,1,5) AND c.trash = 0 AND ( i.publish_up = '0000-00-00 00:00:00' OR i.publish_up <= '2024-09-06 03:44:01' ) AND ( i.publish_down = '0000-00-00 00:00:00' OR i.publish_down >= '2024-09-06 03:44:01' ) AND c.id IN (28,31,34,35,36,37,44,50,52,68,84) AND ( i.`collection_id` = 44 OR i.`collection_id` = 45 OR i.`collection_id` = 48 OR i.`collection_id` = 63) AND ( (i.`color_id` LIKE '%,27,%' OR i.`color_id` = 27) OR (i.`color_id` LIKE '%,34,%' OR i.`color_id` = 34) ) AND ( i.tm='Red-n-Rock\'s') AND ( i.sizes LIKE '%46%' OR i.sizes LIKE '%50%' OR i.sizes LIKE '%52%' ) AND i.material IN (5,25,26,7,8,9,10,11,20,23,24,28,29) ORDER BY coll.ordering DESC, `available` DESC, `sketch` ASC, catalog_order ASC, fullrange, CHAR_LENGTH(i.sizes) DESC, `newopt` DESC, i.hits DESC, i.id DESC
SELECT i.*,
IF(i.catid IN (31,32,33),'1',IF(i.catid IN (35),'2',IF(i.catid IN (36,40),'3',
IF(i.catid IN (52,65,64),'4',IF(i.catid IN (34,38,63),'5',IF(i.catid IN(44,45,67),'6',
IF(i.catid IN(50,54),'7',IF(i.catid IN(53),'8','9')))))))) AS catalog_order,
IF(CHAR_LENGTH(i.size_range)=CHAR_LENGTH(i.sizes) OR CHAR_LENGTH(i.size_range)=CHAR_LENGTH(i.sizes) -1,'1','2') AS fullrange,
coll.filter_value as collection_name, st.text AS saletext, st.amount AS saleamount, IF(i.sizes != '',1,0) AS `available`, i.price_retail * ( 100 - IFNULL(i.discount, 0) )/100 AS realprice, c.name as categoryname,c.id as categoryid, c.alias as categoryalias, c.params as categoryparams, c.retail AS for_retail FROM jos_k2_items as i RIGHT JOIN jos_k2_categories AS c ON c.id = i.catid LEFT JOIN jos_sales_types AS st ON i.active_sale = st.name LEFT JOIN jos_filters AS coll ON i.collection_id = coll.id WHERE i.published = 1 AND i.sizes != '' AND i.size_range !='' AND i.access IN(1,1,5) AND i.trash = 0 AND c.published = 1 AND c.access IN(1,1,5) AND c.trash = 0 AND ( i.publish_up = '0000-00-00 00:00:00' OR i.publish_up <= '2024-09-06 03:44:01' ) AND ( i.publish_down = '0000-00-00 00:00:00' OR i.publish_down >= '2024-09-06 03:44:01' ) AND c.id IN (28,31,34,35,36,37,44,50,52,68,84) AND ( i.`collection_id` = 44 OR i.`collection_id` = 45 OR i.`collection_id` = 48 OR i.`collection_id` = 63) AND ( (i.`color_id` LIKE '%,27,%' OR i.`color_id` = 27) OR (i.`color_id` LIKE '%,34,%' OR i.`color_id` = 34) ) AND ( (i.`style_id` LIKE '%,59,%' OR i.`style_id` = 59) OR (i.`style_id` LIKE '%,61,%' OR i.`style_id` = 61) ) AND ( i.tm='Red-n-Rock\'s') AND ( i.sizes LIKE '%46%' OR i.sizes LIKE '%50%' OR i.sizes LIKE '%52%' ) AND i.material IN (5,25,26,7,8,9,10,11,20,23,24,28,29) ORDER BY coll.ordering DESC, `available` DESC, `sketch` ASC, catalog_order ASC, fullrange, CHAR_LENGTH(i.sizes) DESC, `newopt` DESC, i.hits DESC, i.id DESC
SELECT i.*,
IF(i.catid IN (31,32,33),'1',IF(i.catid IN (35),'2',IF(i.catid IN (36,40),'3',
IF(i.catid IN (52,65,64),'4',IF(i.catid IN (34,38,63),'5',IF(i.catid IN(44,45,67),'6',
IF(i.catid IN(50,54),'7',IF(i.catid IN(53),'8','9')))))))) AS catalog_order,
IF(CHAR_LENGTH(i.size_range)=CHAR_LENGTH(i.sizes) OR CHAR_LENGTH(i.size_range)=CHAR_LENGTH(i.sizes) -1,'1','2') AS fullrange,
coll.filter_value as collection_name, st.text AS saletext, st.amount AS saleamount, IF(i.sizes != '',1,0) AS `available`, i.price_retail * ( 100 - IFNULL(i.discount, 0) )/100 AS realprice, c.name as categoryname,c.id as categoryid, c.alias as categoryalias, c.params as categoryparams, c.retail AS for_retail FROM jos_k2_items as i RIGHT JOIN jos_k2_categories AS c ON c.id = i.catid LEFT JOIN jos_sales_types AS st ON i.active_sale = st.name LEFT JOIN jos_filters AS coll ON i.collection_id = coll.id WHERE i.published = 1 AND i.sizes != '' AND i.size_range !='' AND i.access IN(1,1,5) AND i.trash = 0 AND c.published = 1 AND c.access IN(1,1,5) AND c.trash = 0 AND ( i.publish_up = '0000-00-00 00:00:00' OR i.publish_up <= '2024-09-06 03:44:01' ) AND ( i.publish_down = '0000-00-00 00:00:00' OR i.publish_down >= '2024-09-06 03:44:01' ) AND c.id IN (28,31,34,35,36,37,44,50,52,68,84) AND ( i.`collection_id` = 44 OR i.`collection_id` = 45 OR i.`collection_id` = 48 OR i.`collection_id` = 63) AND ( (i.`color_id` LIKE '%,27,%' OR i.`color_id` = 27) OR (i.`color_id` LIKE '%,34,%' OR i.`color_id` = 34) ) AND ( (i.`style_id` LIKE '%,59,%' OR i.`style_id` = 59) OR (i.`style_id` LIKE '%,61,%' OR i.`style_id` = 61) ) AND ( i.tm='Red-n-Rock\'s') AND i.material IN (5,25,26,7,8,9,10,11,20,23,24,28,29) ORDER BY coll.ordering DESC, `available` DESC, `sketch` ASC, catalog_order ASC, fullrange, CHAR_LENGTH(i.sizes) DESC, `newopt` DESC, i.hits DESC, i.id DESC
SELECT i.*,
IF(i.catid IN (31,32,33),'1',IF(i.catid IN (35),'2',IF(i.catid IN (36,40),'3',
IF(i.catid IN (52,65,64),'4',IF(i.catid IN (34,38,63),'5',IF(i.catid IN(44,45,67),'6',
IF(i.catid IN(50,54),'7',IF(i.catid IN(53),'8','9')))))))) AS catalog_order,
IF(CHAR_LENGTH(i.size_range)=CHAR_LENGTH(i.sizes) OR CHAR_LENGTH(i.size_range)=CHAR_LENGTH(i.sizes) -1,'1','2') AS fullrange,
coll.filter_value as collection_name, st.text AS saletext, st.amount AS saleamount, IF(i.sizes != '',1,0) AS `available`, i.price_retail * ( 100 - IFNULL(i.discount, 0) )/100 AS realprice, c.name as categoryname,c.id as categoryid, c.alias as categoryalias, c.params as categoryparams, c.retail AS for_retail FROM jos_k2_items as i RIGHT JOIN jos_k2_categories AS c ON c.id = i.catid LEFT JOIN jos_sales_types AS st ON i.active_sale = st.name LEFT JOIN jos_filters AS coll ON i.collection_id = coll.id WHERE i.published = 1 AND i.sizes != '' AND i.size_range !='' AND i.access IN(1,1,5) AND i.trash = 0 AND c.published = 1 AND c.access IN(1,1,5) AND c.trash = 0 AND ( i.publish_up = '0000-00-00 00:00:00' OR i.publish_up <= '2024-09-06 03:44:01' ) AND ( i.publish_down = '0000-00-00 00:00:00' OR i.publish_down >= '2024-09-06 03:44:01' ) AND c.id IN (28,31,34,35,36,37,44,50,52,68,84) AND ( i.`collection_id` = 44 OR i.`collection_id` = 45 OR i.`collection_id` = 48 OR i.`collection_id` = 63) AND ( (i.`color_id` LIKE '%,27,%' OR i.`color_id` = 27) OR (i.`color_id` LIKE '%,34,%' OR i.`color_id` = 34) ) AND ( (i.`style_id` LIKE '%,59,%' OR i.`style_id` = 59) OR (i.`style_id` LIKE '%,61,%' OR i.`style_id` = 61) ) AND ( i.tm='Red-n-Rock\'s') AND ( i.sizes LIKE '%46%' OR i.sizes LIKE '%50%' OR i.sizes LIKE '%52%' ) ORDER BY coll.ordering DESC, `available` DESC, `sketch` ASC, catalog_order ASC, fullrange, CHAR_LENGTH(i.sizes) DESC, `newopt` DESC, i.hits DESC, i.id DESC
SELECT i.*,
IF(i.catid IN (31,32,33),'1',IF(i.catid IN (35),'2',IF(i.catid IN (36,40),'3',
IF(i.catid IN (52,65,64),'4',IF(i.catid IN (34,38,63),'5',IF(i.catid IN(44,45,67),'6',
IF(i.catid IN(50,54),'7',IF(i.catid IN(53),'8','9')))))))) AS catalog_order,
IF(CHAR_LENGTH(i.size_range)=CHAR_LENGTH(i.sizes) OR CHAR_LENGTH(i.size_range)=CHAR_LENGTH(i.sizes) -1,'1','2') AS fullrange,
coll.filter_value as collection_name, st.text AS saletext, st.amount AS saleamount, IF(i.sizes != '',1,0) AS `available`, i.price_retail * ( 100 - IFNULL(i.discount, 0) )/100 AS realprice, c.name as categoryname,c.id as categoryid, c.alias as categoryalias, c.params as categoryparams, c.retail AS for_retail FROM jos_k2_items as i RIGHT JOIN jos_k2_categories AS c ON c.id = i.catid LEFT JOIN jos_sales_types AS st ON i.active_sale = st.name LEFT JOIN jos_filters AS coll ON i.collection_id = coll.id WHERE i.published = 1 AND i.sizes != '' AND i.size_range !='' AND i.access IN(1,1,5) AND i.trash = 0 AND c.published = 1 AND c.access IN(1,1,5) AND c.trash = 0 AND ( i.publish_up = '0000-00-00 00:00:00' OR i.publish_up <= '2024-09-06 03:44:01' ) AND ( i.publish_down = '0000-00-00 00:00:00' OR i.publish_down >= '2024-09-06 03:44:01' ) AND c.id IN (28,31,34,35,36,37,44,50,52,68,84) AND ( i.`collection_id` = 44 OR i.`collection_id` = 45 OR i.`collection_id` = 48 OR i.`collection_id` = 63) AND ( (i.`color_id` LIKE '%,27,%' OR i.`color_id` = 27) OR (i.`color_id` LIKE '%,34,%' OR i.`color_id` = 34) ) AND ( (i.`style_id` LIKE '%,59,%' OR i.`style_id` = 59) OR (i.`style_id` LIKE '%,61,%' OR i.`style_id` = 61) ) AND ( i.sizes LIKE '%46%' OR i.sizes LIKE '%50%' OR i.sizes LIKE '%52%' ) AND i.material IN (5,25,26,7,8,9,10,11,20,23,24,28,29) ORDER BY coll.ordering DESC, `available` DESC, `sketch` ASC, catalog_order ASC, fullrange, CHAR_LENGTH(i.sizes) DESC, `newopt` DESC, i.hits DESC, i.id DESC
SELECT i.*,
IF(i.catid IN (31,32,33),'1',IF(i.catid IN (35),'2',IF(i.catid IN (36,40),'3',
IF(i.catid IN (52,65,64),'4',IF(i.catid IN (34,38,63),'5',IF(i.catid IN(44,45,67),'6',
IF(i.catid IN(50,54),'7',IF(i.catid IN(53),'8','9')))))))) AS catalog_order,
IF(CHAR_LENGTH(i.size_range)=CHAR_LENGTH(i.sizes) OR CHAR_LENGTH(i.size_range)=CHAR_LENGTH(i.sizes) -1,'1','2') AS fullrange,
coll.filter_value as collection_name, st.text AS saletext, st.amount AS saleamount, IF(i.sizes != '',1,0) AS `available`, i.price_retail * ( 100 - IFNULL(i.discount, 0) )/100 AS realprice, c.name as categoryname,c.id as categoryid, c.alias as categoryalias, c.params as categoryparams, c.retail AS for_retail FROM jos_k2_items as i RIGHT JOIN jos_k2_categories AS c ON c.id = i.catid LEFT JOIN jos_sales_types AS st ON i.active_sale = st.name LEFT JOIN jos_filters AS coll ON i.collection_id = coll.id WHERE i.published = 1 AND i.sizes != '' AND i.size_range !='' AND i.access IN(1,1,5) AND i.trash = 0 AND c.published = 1 AND c.access IN(1,1,5) AND c.trash = 0 AND ( i.publish_up = '0000-00-00 00:00:00' OR i.publish_up <= '2024-09-06 03:44:01' ) AND ( i.publish_down = '0000-00-00 00:00:00' OR i.publish_down >= '2024-09-06 03:44:01' ) AND c.id IN (28,31,34,35,36,37,44,50,52,68,84) AND ( (i.`color_id` LIKE '%,27,%' OR i.`color_id` = 27) OR (i.`color_id` LIKE '%,34,%' OR i.`color_id` = 34) ) AND ( (i.`style_id` LIKE '%,59,%' OR i.`style_id` = 59) OR (i.`style_id` LIKE '%,61,%' OR i.`style_id` = 61) ) AND ( i.tm='Red-n-Rock\'s') AND ( i.sizes LIKE '%46%' OR i.sizes LIKE '%50%' OR i.sizes LIKE '%52%' ) AND i.material IN (5,25,26,7,8,9,10,11,20,23,24,28,29) ORDER BY coll.ordering DESC, `available` DESC, `sketch` ASC, catalog_order ASC, fullrange, CHAR_LENGTH(i.sizes) DESC, `newopt` DESC, i.hits DESC, i.id DESC
SELECT i.*,
IF(i.catid IN (31,32,33),'1',IF(i.catid IN (35),'2',IF(i.catid IN (36,40),'3',
IF(i.catid IN (52,65,64),'4',IF(i.catid IN (34,38,63),'5',IF(i.catid IN(44,45,67),'6',
IF(i.catid IN(50,54),'7',IF(i.catid IN(53),'8','9')))))))) AS catalog_order,
IF(CHAR_LENGTH(i.size_range)=CHAR_LENGTH(i.sizes) OR CHAR_LENGTH(i.size_range)=CHAR_LENGTH(i.sizes) -1,'1','2') AS fullrange,
coll.filter_value as collection_name, st.text AS saletext, st.amount AS saleamount, IF(i.sizes != '',1,0) AS `available`, i.price_retail * ( 100 - IFNULL(i.discount, 0) )/100 AS realprice, c.name as categoryname,c.id as categoryid, c.alias as categoryalias, c.params as categoryparams, c.retail AS for_retail FROM jos_k2_items as i RIGHT JOIN jos_k2_categories AS c ON c.id = i.catid LEFT JOIN jos_sales_types AS st ON i.active_sale = st.name LEFT JOIN jos_filters AS coll ON i.collection_id = coll.id WHERE i.published = 1 AND i.sizes != '' AND i.size_range !='' AND i.access IN(1,1,5) AND i.trash = 0 AND c.published = 1 AND c.access IN(1,1,5) AND c.trash = 0 AND ( i.publish_up = '0000-00-00 00:00:00' OR i.publish_up <= '2024-09-06 03:44:01' ) AND ( i.publish_down = '0000-00-00 00:00:00' OR i.publish_down >= '2024-09-06 03:44:01' ) AND c.id IN (28,31,34,35,36,37,44,50,52,68,84) AND ( (i.`color_id` LIKE '%,27,%' OR i.`color_id` = 27) OR (i.`color_id` LIKE '%,34,%' OR i.`color_id` = 34) ) AND ( (i.`style_id` LIKE '%,59,%' OR i.`style_id` = 59) OR (i.`style_id` LIKE '%,61,%' OR i.`style_id` = 61) ) AND ( i.tm='Red-n-Rock\'s') AND ( i.sizes LIKE '%46%' OR i.sizes LIKE '%50%' OR i.sizes LIKE '%52%' ) AND i.material IN (5,25,26,7,8,9,10,11,20,23,24,28,29) ORDER BY coll.ordering DESC, `available` DESC, `sketch` ASC, catalog_order ASC, fullrange, CHAR_LENGTH(i.sizes) DESC, `newopt` DESC, i.hits DESC, i.id DESC
Спортивная одежда для мужчин
Спортивная одежда для мужчин оптом от производителя