diff --git a/app/Http/Controllers/Admin/StatisticsController.php b/app/Http/Controllers/Admin/StatisticsController.php index d943d21..b95ad25 100755 --- a/app/Http/Controllers/Admin/StatisticsController.php +++ b/app/Http/Controllers/Admin/StatisticsController.php @@ -442,4 +442,29 @@ class StatisticsController extends CommonController return $list; } + /** + * 床位统计 + * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View + */ + public function bed() + { + $projects = $this->_checkProjects(); + if (!$projects->count()) { + return $this->error($this->noProjects); + } + $project_id = request()->project_id ?? $projects->first()->id; + $project = Project::find($project_id); + + $month = request()->month ?? date("Y-m"); + $months = $this->_getMonths(); + $area = Area::withCount('beds')->where('project_id', $project_id)->get(); + $totalBed = Bed::whereIn('area_id', $area->pluck('id'))->where('project_id', $project_id)->count(); + foreach ($area as $item) { + dd($item); + // $item->bed_rate = round($item->beds_count/) + + } + return view($this->bladePath . ".bed", compact("area", "project", "month")); + } + } diff --git a/resources/views/admin/statistics/bed.blade.php b/resources/views/admin/statistics/bed.blade.php new file mode 100755 index 0000000..1f9dfb4 --- /dev/null +++ b/resources/views/admin/statistics/bed.blade.php @@ -0,0 +1,59 @@ +@extends("admin.layouts.layout") + +@push("header") + +@endpush + +@section("content") +
+
+
+
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
项目所属周期上月未结算余额本月收款本月退款本月结算本月未结算余额院方结算
{{ $project->name }}{{ date("Y年m月", strtotime($month)) }}{{ $prev_month_balance }}{{ $this_month_balances->filter(function($item) { return $item->belongs_type == "App\Models\Recharge"; })->sum("money") }}{{ $this_month_balances->filter(function($item) { return $item->belongs_type == "App\Models\Refund"; })->sum("money") }}{{ $this_month_balances->filter(function($item) { return $item->belongs_type == "App\Models\OrderItems"; })->sum("money") }}{{ $this_month_balance }}@if($project->percent_first_party){{ -$this_month_balances->filter(function($item) { return $item->belongs_type == "App\Models\OrderItems"; })->sum("money") * $project->percent_first_party / 100 }}@else{{ "未设置" }}@endif
+
+
+
+
+ +@endsection diff --git a/routes/web.php b/routes/web.php index 8ad74b2..df30d0c 100644 --- a/routes/web.php +++ b/routes/web.php @@ -95,6 +95,7 @@ Route::group(["namespace" => "Admin", "prefix" => "admin"], function () { Route::get("orders/artboard", 'OrdersController@artboard'); + Route::get("statistics/bed", 'StatisticsController@bed'); Route::get("statistics/huli", 'StatisticsController@huli'); Route::get("statistics/overview", 'StatisticsController@overview'); Route::get("statistics/salary", 'StatisticsController@salary');