add product

This commit is contained in:
2015-09-24 22:14:09 +02:00
parent fcc18d79f6
commit a2b835225a
15 changed files with 229 additions and 80 deletions

View File

@@ -18,8 +18,8 @@ class ProductSearch extends Product
public function rules()
{
return [
[['id_product', 'id_product_type', 'id_account', 'purchase_price', 'sale_price', 'profit_margins', 'status'], 'integer'],
[['product_number', 'barcode', 'description', 'created_at', 'updated_at'], 'safe'],
[[ 'id_product_category', 'id_account', 'status'], 'integer'],
[['product_number', 'barcode' ], 'safe'],
];
}
@@ -56,20 +56,13 @@ class ProductSearch extends Product
}
$query->andFilterWhere([
'id_product' => $this->id_product,
'id_product_type' => $this->id_product_type,
'id_product_category' => $this->id_product_category,
'id_account' => $this->id_account,
'purchase_price' => $this->purchase_price,
'sale_price' => $this->sale_price,
'profit_margins' => $this->profit_margins,
'status' => $this->status,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
]);
$query->andFilterWhere(['like', 'product_number', $this->product_number])
->andFilterWhere(['like', 'barcode', $this->barcode])
->andFilterWhere(['like', 'description', $this->description]);
->andFilterWhere(['like', 'barcode', $this->barcode]);
return $dataProvider;
}