<?php //making a RestFul API service require '../classes/providerRepository.php'; header('Content-type: application/json'); echo ")]}'\n"; $provider = Providers::getProviders(); echo json_encode($provider);
<li><a href="Update://" onclick="updateMinPrices();return false;">Обновить минимальные цены</a></li> <li><a href="import_relations.php">Импорт соответствий</a></li> <li><a href="convert_for_import.php">Конвертировать для импорта</a></li> </ul> <!--[if lte IE 6]></td></tr></table></a><![endif]--> </li> <li><a href="providers.php">Поставщики<!--[if IE 7]><!--></a><!--<![endif]--> <!--[if lte IE 6]><table><tr><td><![endif]--> <ul> <li><a href="convert.php">Импорт прайса</a></li> <li><a class="drop" href="providers.php">Поставщики <?php $providers =& Providers::getProviders(); if (count($providers)) { echo '<div class="arrow">»</div><!--[if IE 7]><!--></a><!--<![endif]--> <!--[if lte IE 6]><table><tr><td><![endif]--> <ul>'; foreach ($providers as $id => $provider) { echo '<li><a href="provider.php?id=' . $id . '">' . $provider['name'] . '</a></li>'; } echo '</ul> <!--[if lte IE 6]></td></tr></table></a><![endif]-->'; } ?> </li> <li><a href="prov_prods.php">Товары поставщиков</a></li> <li><a href="provider.php">Добавить поставщика</a></li>
public static function getOurProductsCount($filter_str) { $db =& DB::singleton(); $db->selectDb(MYSQL_DB_STORE); if (strlen($filter_str)) { $filter_str = " where " . $filter_str; } //$res = $db->getValue("select count(*) from our_products $filter_str"); $provs =& Providers::getProviders(); $columns = "min_prods.price as min_price, "; $join_str = "left join (select sku,price from " . MYSQL_DB . ".providers_products where is_min_price=1 group by sku) as min_prods on min_prods.sku=e.sku"; foreach ($provs as $id => $prov) { $columns .= "providers_products_{$id}.price as providers_products_{$id}_price, "; $join_str .= " left join " . MYSQL_DB . ".providers_products as providers_products_{$id} on e.sku=providers_products_{$id}.sku and providers_products_{$id}.prov_id={$id}"; } $shop_prods_count = "select count(*) from (SELECT `e`.`entity_id` FROM `catalog_product_entity` AS `e` LEFT JOIN `catalog_product_entity_int` AS `_table_manufacturer` ON (_table_manufacturer.entity_id = e.entity_id) AND (_table_manufacturer.attribute_id='66') AND (_table_manufacturer.store_id=0) LEFT JOIN `eav_attribute_option_value` ON _table_manufacturer.value=eav_attribute_option_value.option_id and eav_attribute_option_value.store_id = 0 LEFT JOIN `catalog_category_entity` ON e.category_ids regexp concat('(^',catalog_category_entity.entity_id, '\$)|(^',catalog_category_entity.entity_id,',)|(,',catalog_category_entity.entity_id,',)|(,',catalog_category_entity.entity_id,'\$)') LEFT JOIN `catalog_category_entity_varchar` ON catalog_category_entity.entity_id=catalog_category_entity_varchar.entity_id and catalog_category_entity_varchar.store_id=0 and catalog_category_entity_varchar.attribute_id=31 {$join_str} {$filter_str} GROUP BY `e`.`entity_id`) count_table"; $res = $db->getValue($shop_prods_count); $db->selectDb(MYSQL_DB); return $res; }