upMerge branch 'master' of 210.16.180.245:/data/git/tiantian2

master
weizong song 2 years ago
commit 1ff5189256

@ -553,14 +553,18 @@ class StatisticsController extends CommonController
foreach ($areaList as $item) { foreach ($areaList as $item) {
$beds = Bed::where('area_id', $item->id)->where('project_id', $project_id)->get(); $beds = Bed::where('area_id', $item->id)->where('project_id', $project_id)->get();
// 订单总数 // 订单总数
$orders = Orders::where('project_id', $project_id) // $orders = Orders::where('project_id', $project_id)
// ->where('created_at', 'like', '%' . $month . '%') // ->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')) ->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"); ->sum("money");
$item->order_total = $orderTotal; $item->order_total = $orderTotal;
$item->shouxufei = round($orderTotal * 0.006, 2); $item->shouxufei = round($orderTotal * 0.006, 2);
$item->zengshishui = round($orderTotal * 0.06, 2); $item->zengshishui = round($orderTotal * 0.06, 2);
@ -576,14 +580,6 @@ class StatisticsController extends CommonController
$total['shijishouru'] += $item->shijishouru; $total['shijishouru'] += $item->shijishouru;
$total['guanlifei'] += $item->guanlifei; $total['guanlifei'] += $item->guanlifei;
} }
// 获取所有订单数据
// $beds = Bed::whereIn('area_id', $areaList->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'] = abs(Balance::where('created_at', 'like', '%' . $month . '%') $refund['order_total'] = abs(Balance::where('created_at', 'like', '%' . $month . '%')
->where('belongs_type', 'App\Models\Refund') ->where('belongs_type', 'App\Models\Refund')
->whereHas("order", function ($query) use ($project_id) { ->whereHas("order", function ($query) use ($project_id) {

Loading…
Cancel
Save