master
cody 1 year ago
parent ec946a4266
commit 68eaf47216

@ -402,6 +402,7 @@ class StatisticsController extends CommonController
$query->whereIn('id', $areaId);
}
})->paginate(40);
$data->appends($request->all())->render();
$product = Product::where('project_id', $project_id)->first();
$productItem = ProductItems::where('product_id', $product->id)->get();
@ -552,19 +553,9 @@ class StatisticsController extends CommonController
$area = [];
foreach ($areaList as $item) {
$beds = Bed::where('area_id', $item->id)->where('project_id', $project_id)->get();
// 订单总数
// $orders = Orders::where('project_id', $project_id)
// ->whereIn('bed_id', $beds->pluck('id'))
// ->get();
// $orderTotal = Balance::where('created_at', 'like', '%' . $month . '%')
// ->where('belongs_type', 'App\Models\Recharge')
// ->whereIn('order_id', $orders->pluck('id'))
// ->sum("money");
$orderTotal = OrderItems::where('paid_at', 'like', '%' . $month . '%')
->whereIn('bed_id', $beds->pluck('id'))
->sum("total");
$item->order_total = $orderTotal;
$item->shouxufei = round($orderTotal * 0.006, 2);
$item->zengshishui = round($orderTotal * 0.06, 2);

Loading…
Cancel
Save