sell product changes

This commit is contained in:
2015-10-05 07:37:17 +02:00
parent e9f9567618
commit 36c8d37914
18 changed files with 704 additions and 141 deletions

View File

@@ -154,11 +154,13 @@ class Product extends \common\models\BaseFitnessActiveRecord {
return ArrayHelper::toArray($product, [
'common\models\Product' => [
'id_product',
'name',
'product_number',
'barcode',
'sale_price',
'stock',
'id_account',
'category' => function ($product) {
return $product->productCategoryName;
},
@@ -166,4 +168,8 @@ class Product extends \common\models\BaseFitnessActiveRecord {
]);
}
public static function sellProduct($product,$count){
$product->stock = $product->stock - $count;
}
}