// AdminWarehousesController : added informations on the shops associated to a warehouse on the 'view' action

This commit is contained in:
bMancone
2011-11-15 09:28:54 +00:00
parent cff17ab35d
commit 2fa5234c37
3 changed files with 26 additions and 10 deletions
+3 -9
View File
@@ -107,20 +107,14 @@ class WarehouseCore extends ObjectModel
*/
public function getShops()
{
$ids_shop = array();
$query = new DbQuery();
$query->select('ws.id_shop');
$query->select('ws.id_shop, s.name');
$query->from('warehouse_shop ws');
$query->leftJoin('shop s ON (s.id_shop = ws.id_shop)');
$query->where($this->identifier.' = '.(int)$this->id);
$res = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query);
foreach ($res as $shops)
foreach ($shops as $shop)
$ids_shop[] = $shop;
return $ids_shop;
return $res;
}
/**