fix discount , using floor method, change version to 0.0.30

This commit is contained in:
2016-02-01 21:48:39 +01:00
parent 7b4fe04229
commit e9bdcb715d
4 changed files with 5 additions and 2 deletions

View File

@@ -114,7 +114,7 @@ class Discount extends \yii\db\ActiveRecord
* */
public static function applyDiscount($money,$discount){
$result = $money;
$valueOfDiscount = $money * $discount->value / 100;
$valueOfDiscount = floor( $money * $discount->value / 100 );
$result = $money - $valueOfDiscount;
return $result;
}