bug fix
This commit is contained in:
parent
1f97352d2b
commit
c417aadee4
|
@ -96,9 +96,15 @@ class SellController extends AbstractController
|
|||
$avg = $avg + $last->getBd();
|
||||
$count = $count + $last->getCommdityCount();
|
||||
}
|
||||
if ($count != 0) {
|
||||
$price = $avg / $count;
|
||||
$profit = $profit + ((($item->getBs() / $item->getCommdityCount()) - $price) * $item->getCommdityCount());
|
||||
}
|
||||
else{
|
||||
$profit = $profit + $item->getBs();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//round output
|
||||
$profit = round($profit);
|
||||
|
@ -419,9 +425,14 @@ class SellController extends AbstractController
|
|||
$avg = $avg + $last->getBd();
|
||||
$count = $count + $last->getCommdityCount();
|
||||
}
|
||||
if ($count != 0) {
|
||||
$price = $avg / $count;
|
||||
$temp['profit'] = $temp['profit'] + ((($item->getBs() / $item->getCommdityCount()) - $price) * $item->getCommdityCount());
|
||||
}
|
||||
else{
|
||||
$temp['profit'] = $temp['profit'] + $item->getBs();
|
||||
}
|
||||
}
|
||||
|
||||
//round output
|
||||
$temp['profit'] = round($temp['profit']);
|
||||
|
|
Loading…
Reference in a new issue