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