pastebin - collaborative debugging tool
hn.kpaste.net RSS


Untitled
Posted by NotLim on Fri 11th Dec 2015 15:29
raw | new post

  1. | 4149943 | bikefact_admin | localhost | bikefact_sql       | Query   | 0    | Sending data | SELECT p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity, MAX(product_attribute_shop.id_product_attribute) id_product_attribute, MAX(product_attribute_shop.minimal_quantity) AS product_attribute_minimal_quantity, pl.`description`, pl.`description_short`, pl.`available_now`,
  2.                                         pl.`available_later`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, MAX(image_shop.`id_image`) id_image,
  3.                                         MAX(il.`legend`) as legend, m.`name` AS manufacturer_name, cl.`name` AS category_default,
  4.                                         DATEDIFF(product_shop.`date_add`, DATE_SUB(NOW(),
  5.                                         INTERVAL 20
  6.                                                 DAY)) > 0 AS new, product_shop.price AS orderprice
  7.                                 FROM `ps_category_product` cp
  8.                                 LEFT JOIN `ps_product` p
  9.                                         ON p.`id_product` = cp.`id_product`
  10.                                  INNER JOIN ps_product_shop product_shop
  11.                 ON (product_shop.id_product = p.id_product AND product_shop.id_shop = 1)LEFT JOIN `ps_product_attribute` pa
  12.                                 ON (p.`id_product` = pa.`id_product`)
  13.                                  LEFT JOIN ps_product_attribute_shop product_attribute_shop
  14.                 ON (product_attribute_shop.id_product_attribute = pa.id_product_attribute AND product_attribute_shop.id_shop = 1 AND product_attribute_shop.`default_on` = 1)
  15.                                  LEFT
  16.                         JOIN ps_stock_available stock
  17.                         ON (stock.id_product = p.id_product AND stock.id_product_attribute = IFNULL(`product_attribute_shop`.id_product_attribute, 0) AND stock.id_shop = 1  AND stock.id_shop_group = 0  )
  18.                                 LEFT JOIN `ps_category_lang` cl
  19.                                         ON (product_shop.`id_category_default` = cl.`id_category`
  20.                                         AND cl.`id_lang` = 4 AND cl.id_shop = 1 )
  21.                                 LEFT JOIN `ps_product_lang` pl
  22.                                         ON (p.`id_product` = pl.`id_product`
  23.                                         AND pl.`id_lang` = 4 AND pl.id_shop = 1 )
  24.                                 LEFT JOIN `ps_image` i
  25.                                         ON (i.`id_product` = p.`id_product`) LEFT JOIN ps_image_shop image_shop
  26.                 ON (image_shop.id_image = i.id_image AND image_shop.id_shop = 1 AND image_shop.cover=1)
  27.                                 LEFT JOIN `ps_image_lang` il
  28.                                         ON (image_shop.`id_image` = il.`id_image`
  29.                                         AND il.`id_lang` = 4)
  30.                                 LEFT JOIN `ps_manufacturer` m
  31.                                         ON m.`id_manufacturer` = p.`id_manufacturer`
  32.                                 WHERE product_shop.`id_shop` = 1
  33.                                         AND cp.`id_category` = 2 AND product_shop.`active` = 1 AND product_shop.`visibility` IN ("both", "catalog") GROUP BY product_shop.id_product ORDER BY RAND() LIMIT 8 |

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at