start shipping zone management

This commit is contained in:
Manuel Raynaud
2013-10-14 14:08:50 +02:00
parent 75bc86d43e
commit 9c4c63a564
4 changed files with 38 additions and 88 deletions

View File

@@ -42,4 +42,6 @@ class ShippingZoneController extends BaseAdminController
"shipping_zones_id" => $shipping_zones_id
));
}
}

View File

@@ -75,7 +75,9 @@ class Area extends BaseLoop
protected function getArgDefinitions()
{
return new ArgumentCollection(
Argument::createIntListTypeArgument('id')
Argument::createIntListTypeArgument('id'),
Argument::createIntTypeArgument('with_zone'),
Argument::createIntTypeArgument('without_zone')
);
}
@@ -101,6 +103,24 @@ class Area extends BaseLoop
$search->filterById($id, Criteria::IN);
}
$withZone = $this->getWith_zone();
if ($withZone) {
$search->joinAreaDeliveryModule('with_zone')
->where('`with_zone`.delivery_module_id '.Criteria::EQUAL.' ?', $withZone, \PDO::PARAM_INT);
}
$withoutZone = $this->getWithout_zone();
if($withoutZone)
{
$search->joinAreaDeliveryModule('without_zone', Criteria::LEFT_JOIN)
->addJoinCondition('without_zone', 'delivery_module_id '.Criteria::EQUAL.' ?', $withoutZone, null, \PDO::PARAM_INT)
->where('`without_zone`.delivery_module_id '.Criteria::ISNULL);
}
//echo $search->toString(); exit;
$areas = $this->search($search, $pagination);
$loopResult = new LoopResult($areas);