add inventory to frontend

This commit is contained in:
2016-03-24 07:44:00 +01:00
parent e7b16f20ce
commit ed837d6580
27 changed files with 1259 additions and 71 deletions

View File

@@ -78,7 +78,7 @@ class Inventory extends \common\models\BaseFitnessActiveRecord
if ( $insert ){
$query = Product::find();
if ( isset($this->id_account) && !is_numeric($this->id_account)){
if ( isset($this->id_account) && is_numeric($this->id_account)){
$query->andWhere(['id_account' => $this->id_account]);
}
@@ -102,6 +102,18 @@ class Inventory extends \common\models\BaseFitnessActiveRecord
$form->save();
}
foreach ($inventoryGroups as $group){
$form = new InventoryItemForm(
[
'inventory' => $this,
'id_product' => $group->id_inventory_group,
'inventoryGroup' => $group,
'type' => 'group'
]
);
$form->save();
}
}