|
|
|
|
@ -553,9 +553,10 @@ class StatisticsController extends CommonController
|
|
|
|
|
foreach ($areaList as $item) {
|
|
|
|
|
$beds = Bed::where('area_id', $item->id)->where('project_id', $project_id)->get();
|
|
|
|
|
// 订单总数
|
|
|
|
|
$orderTotal = Orders::where('project_id', $project_id)
|
|
|
|
|
$orderTotal = OrderItems::where('project_id', $project_id)
|
|
|
|
|
->where('created_at', 'like', '%' . $month . '%')
|
|
|
|
|
->whereIn('bed_id', $beds->pluck('id'))
|
|
|
|
|
->whereNotNull('paid_at')
|
|
|
|
|
->sum('total');
|
|
|
|
|
$item->order_total = $orderTotal;
|
|
|
|
|
$item->shouxufei = round($orderTotal * 0.006, 2);
|
|
|
|
|
|