Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT SQL_CALC_FOUND_ROWS
- am.id AS id,
- am.manufacturer_id AS manufacturer_id,
- cat.name AS manufacturers_category_name,
- am.add_sum AS add_sum,
- am.add_percent AS add_percent,
- am.man_id AS man_id,
- am.date_changed AS date_changed,
- am.date_added AS date_added,
- m.manufacturers_name AS manufacturers_name,
- CONCAT(man.firstname, ' ', man.lastname) AS man_name,
- (SELECT
- COUNT(*)
- FROM
- sotm_products
- WHERE
- manufacturers_id = am.manufacturer_id) AS products_in_group,
- (SELECT
- COUNT(*)
- FROM
- crm_priceparser_price_history as ph
- INNER JOIN
- sotm_id1c_default_product as dp ON dp.id1c = ph.id1c
- INNER JOIN
- sotm_products as sp ON sp.products_id = dp.product_id
- WHERE
- ph.status = 2
- AND sp.manufacturers_id IN (am.manufacturer_id)) AS price_to_edit
- FROM
- crm_priceparser_additions_manufacturers AS am
- JOIN
- manufacturers AS m ON am.manufacturer_id = m.manufacturers_id
- JOIN
- sotm_category as cat ON cat.category_id = am.category_id
- JOIN
- categories ON categories.categories_id = cat.category_id
- JOIN
- managers AS man ON man.man_id = am.man_id
- WHERE
- 0 = 0
- ORDER BY am.date_changed DESC
- LIMIT 0 , 100
Advertisement
Add Comment
Please, Sign In to add comment