cody 2 years ago
parent 995aafbca5
commit d25098b0b2

@ -92,12 +92,11 @@ class HomeController extends CommonController
foreach ($allMontn as $month) {
$saleList[] = [
'month' => $month,
'total' => (new OrderItems())->where("service_date", $month)->whereHas("order", function ($query) use ($project_id) {
'total' => (new OrderItems())->where("service_date", 'like', $month . '%')->whereHas("order", function ($query) use ($project_id) {
$query->ofProject($project_id);
})->sum("total")
];
}
dump($saleList);
// 订单量
$orderList = [];
foreach ($allMontn as $month) {
@ -114,7 +113,7 @@ class HomeController extends CommonController
if (is_mobile() || empty($tongji)) {
return view($this->bladePath . ".mobile_home");
} else {
return view($this->bladePath . ".home", compact('project_id','projects','counts', 'lies', 'saleList', 'orderList'));
return view($this->bladePath . ".home", compact('project_id', 'projects', 'counts', 'lies', 'saleList', 'orderList'));
}
}
@ -136,7 +135,7 @@ class HomeController extends CommonController
'product_item_id' => $item->id,
'factor_item_id' => $factor_item->id,
'total' => $total,
'product_item_name'=>$item->name,
'product_item_name' => $item->name,
'rate' => round($total / $order_total, 2)
];
}

Loading…
Cancel
Save