add product
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user