// debug and optimisations for admin stock interfaces

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9555 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
dSevere
2011-10-21 15:04:49 +00:00
parent 9564bf4ef8
commit eb60442a04
4 changed files with 78 additions and 37 deletions
+10 -4
View File
@@ -241,13 +241,19 @@ class WarehouseCore extends ObjectModel
return (Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query));
}
public static function getWarehouseList()
{
public static function getWarehouseList($ignore_shop = false, $id_shop = null)
{
if (!$ignore_shop)
if (is_null($id_shop))
$id_shop = Context::getContext()->shop->getID(true);
$query = new DbQuery();
$query->select('w.id_warehouse, name');
$query->from('warehouse w');
$query->innerJoin('warehouse_shop ws ON ws.id_warehouse = w.id_warehouse AND ws.id_shop = '.Context::getContext()->shop->getID(true));
if (!$ignore_shop)
$query->innerJoin('warehouse_shop ws ON ws.id_warehouse = w.id_warehouse AND ws.id_shop = '.(int)$id_shop);
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query);
}
}