|
|
|
|
@ -567,6 +567,18 @@ class StatisticsController extends CommonController
|
|
|
|
|
$total['guanlifei'] += $item->guanlifei;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取所有订单数据
|
|
|
|
|
$beds = Bed::whereIn('area_id', $area->pluck('id'))->where('project_id', $project_id)->get();
|
|
|
|
|
// 订单总数
|
|
|
|
|
$allOrderTotal = Orders::where('project_id', $project_id)
|
|
|
|
|
->where('created_at', 'like', '%' . $month . '%')
|
|
|
|
|
->whereIn('bed_id', $beds->pluck('id'))
|
|
|
|
|
->get();
|
|
|
|
|
$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);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 导出
|
|
|
|
|
if ($is_export) {
|
|
|
|
|
$area = $area->toArray();
|
|
|
|
|
@ -594,7 +606,7 @@ class StatisticsController extends CommonController
|
|
|
|
|
$writer->save('php://output');
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
return view($this->bladePath . ".income", compact("total","area", "project", "project_id", "month", "projects"));
|
|
|
|
|
return view($this->bladePath . ".income", compact("total", "area", "project", "project_id", "month", "projects"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|