// #PSFV-299
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12159 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+26
-2
@@ -288,7 +288,8 @@ class SupplierCore extends ObjectModel
|
||||
public function getProductsLite($id_lang)
|
||||
{
|
||||
$sql = '
|
||||
SELECT p.`id_product`, pl.`name`
|
||||
SELECT p.`id_product`,
|
||||
pl.`name`
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (
|
||||
p.`id_product` = pl.`id_product`
|
||||
@@ -300,7 +301,8 @@ class SupplierCore extends ObjectModel
|
||||
)
|
||||
GROUP BY p.`id_product`';
|
||||
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
||||
$res = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
||||
return $res;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -328,5 +330,27 @@ class SupplierCore extends ObjectModel
|
||||
if (parent::delete())
|
||||
return $this->deleteImage();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets product informations
|
||||
*
|
||||
* @since 1.5.0
|
||||
* @param int $id_supplier
|
||||
* @param int $id_product
|
||||
* @param int $id_product_attribute
|
||||
* @return array
|
||||
*/
|
||||
public static function getProductInformationsBySupplier($id_supplier, $id_product, $id_product_attribute = 0)
|
||||
{
|
||||
$query = new DbQuery();
|
||||
$query->select('product_supplier_reference, product_supplier_price_te, id_currency');
|
||||
$query->from('product_supplier');
|
||||
$query->where('id_supplier = '.(int)$id_supplier);
|
||||
$query->where('id_product = '.(int)$id_product);
|
||||
$query->where('id_product_attribute = '.(int)$id_product_attribute);
|
||||
$res = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query);
|
||||
|
||||
return $res[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user