|
|
@@ -51,14 +51,17 @@ class StatSaleClass extends BaseClass
|
|
|
$where['addTime'] = ['between', [$currentStartTime, $currentEndTime]];
|
|
|
$list = StockWastageOrderClass::getAllByCondition($where, null, '*');
|
|
|
$totalPrice = 0;
|
|
|
+ $totalCost = 0;
|
|
|
if (!empty($list)) {
|
|
|
foreach ($list as $order) {
|
|
|
$price = $order['price'] ?? 0;
|
|
|
$totalPrice = bcadd($totalPrice, $price, 2);
|
|
|
+ $cost = $order['cost'] ?? 0;
|
|
|
+ $totalCost = bcadd($totalCost, $cost, 2);
|
|
|
}
|
|
|
}
|
|
|
$totalPrice = floatval($totalPrice);
|
|
|
- return ['totalPrice' => $totalPrice];
|
|
|
+ return ['totalPrice' => $totalPrice, 'totalCost' => $totalCost];
|
|
|
}
|
|
|
|
|
|
//结账跟踪 ssh 20230503
|