|
|
|
|
@ -546,6 +546,7 @@ class StatisticsController extends CommonController
|
|
|
|
|
// 当月天数
|
|
|
|
|
$days = date('t', strtotime($month));
|
|
|
|
|
$area = 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) {
|
|
|
|
|
$beds = Bed::where('area_id', $item->id)->where('project_id', $project_id)->get();
|
|
|
|
|
@ -577,7 +578,12 @@ class StatisticsController extends CommonController
|
|
|
|
|
$refund['order_total'] = Refund::where('created_at', 'like', '%' . $month . '%')->whereIn('order_id', $allOrderTotal->pluck('id'))->sum('money');
|
|
|
|
|
$refund['shijishouru'] = $refund['order_total'];
|
|
|
|
|
$refund['guanlifei'] = round($refund['order_total'] * 0.06, 2);
|
|
|
|
|
|
|
|
|
|
// 总计
|
|
|
|
|
$zongji['order_total'] = $total['order_total'] - $refund['order_total'];
|
|
|
|
|
$zongji['shouxufei'] =
|
|
|
|
|
$zongji['zengshishui'] =
|
|
|
|
|
$zongji['shijishouru'] = $total['shijishouru'] - $refund['shijishouru'];
|
|
|
|
|
$zongji['guanlifei'] = $total['guanlifei'] - $refund['guanlifei'];
|
|
|
|
|
|
|
|
|
|
// 导出
|
|
|
|
|
if ($is_export) {
|
|
|
|
|
@ -606,7 +612,7 @@ class StatisticsController extends CommonController
|
|
|
|
|
$writer->save('php://output');
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
return view($this->bladePath . ".income", compact("refund","total", "area", "project", "project_id", "month", "projects"));
|
|
|
|
|
return view($this->bladePath . ".income", compact("zongji","refund", "total", "area", "project", "project_id", "month", "projects"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|