master
cody 2 years ago
parent c251ce5e62
commit 0fe331b372

@ -546,10 +546,11 @@ class StatisticsController extends CommonController
$months = $this->_getMonths();
// 当月天数
$days = date('t', strtotime($month));
$area = Area::withCount('beds')->where('project_id', $project_id)->get();
$areaList = Area::withCount('beds')->where('project_id', $project_id)->get();
// 合计
$total['order_total'] = $total['shouxufei'] = $total['zengshishui'] = $total['shijishouru'] = $total['guanlifei'] = 0;
foreach ($area as $item) {
$area = [];
foreach ($areaList as $item) {
$beds = Bed::where('area_id', $item->id)->where('project_id', $project_id)->get();
// 订单总数
$orderTotal = Orders::where('project_id', $project_id)
@ -561,6 +562,9 @@ class StatisticsController extends CommonController
$item->zengshishui = round($orderTotal * 0.06, 2);
$item->shijishouru = round($orderTotal - $item->shouxufei - $item->zengshishui, 2);
$item->guanlifei = round($item->shijishouru * 0.06, 2);
if (!empty($item->order_total)) {
$area[] = $item;
}
// 合计
$total['order_total'] += $item->order_total;
$total['shouxufei'] += $item->shouxufei;

@ -43,36 +43,36 @@
@foreach ($area as $row)
<tr>
<td>{{ $row->name }}</td>
<td>{{ empty($row->order_total)?'':$row->order_total }}</td>
<td>{{ empty($row->shouxufei)?'':$row->shouxufei }}</td>
<td>{{ empty($row->zengshishui)?'':$row->zengshishui }}</td>
<td>{{ empty($row->shijishouru)?'':$row->shijishouru }}</td>
<td>{{ empty($row->guanlifei)?'':$row->guanlifei }}</td>
<td>{{ $row->order_total }}</td>
<td>{{ $row->shouxufei }}</td>
<td>{{ $row->zengshishui }}</td>
<td>{{ $row->shijishouru }}</td>
<td>{{ $row->guanlifei }}</td>
</tr>
@endforeach
<tr>
<td>合计</td>
<td>{{ empty($total['order_total'])?'':$total['order_total'] }}</td>
<td>{{ empty($total['shouxufei'])?'':$total['shouxufei'] }}</td>
<td>{{ empty($total['zengshishui'])?'':$total['zengshishui'] }}</td>
<td>{{ empty($total['shijishouru'])?'':$total['shijishouru'] }}</td>
<td>{{ empty($total['guanlifei'])?'':$total['guanlifei'] }}</td>
<td>{{ $total['order_total'] }}</td>
<td>{{ $total['shouxufei'] }}</td>
<td>{{ $total['zengshishui'] }}</td>
<td>{{ $total['shijishouru'] }}</td>
<td>{{ $total['guanlifei'] }}</td>
</tr>
<tr>
<td>退款</td>
<td>{{ empty($refund['order_total'])?'':$refund['order_total'] }}</td>
<td>{{ $refund['order_total'] }}</td>
<td></td>
<td></td>
<td>{{ empty($refund['shijishouru'])?'':$refund['shijishouru'] }}</td>
<td>{{ empty($refund['guanlifei'] )?'':$refund['guanlifei'] }}</td>
<td>{{ $refund['shijishouru'] }}</td>
<td>{{ $refund['guanlifei'] }}</td>
</tr>
<tr>
<td>总计</td>
<td>{{ empty($zongji['order_total'])?'':$zongji['order_total'] }}</td>
<td>{{ empty($zongji['shouxufei'])?'':$zongji['shouxufei'] }}</td>
<td>{{ empty($zongji['zengshishui'])?'':$zongji['zengshishui'] }}</td>
<td>{{ empty($zongji['shijishouru'])?'':$zongji['shijishouru'] }}</td>
<td>{{ empty($zongji['guanlifei'])?'':$zongji['guanlifei'] }}</td>
<td>{{ $zongji['order_total'] }}</td>
<td>{{ $zongji['shouxufei'] }}</td>
<td>{{ $zongji['zengshishui'] }}</td>
<td>{{ $zongji['shijishouru'] }}</td>
<td>{{ $zongji['guanlifei'] }}</td>
</tr>
</tbody>
</table>

Loading…
Cancel
Save