|
|
|
|
@ -2,7 +2,11 @@
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Admin;
|
|
|
|
|
|
|
|
|
|
use App\Models\Bed;
|
|
|
|
|
use App\Models\OrderItems;
|
|
|
|
|
use App\Models\Orders;
|
|
|
|
|
use App\Models\Paramedic;
|
|
|
|
|
use App\Models\Project;
|
|
|
|
|
|
|
|
|
|
class HomeController extends CommonController
|
|
|
|
|
{
|
|
|
|
|
@ -26,4 +30,54 @@ class HomeController extends CommonController
|
|
|
|
|
|
|
|
|
|
return view($this->bladePath . ".home");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 统计
|
|
|
|
|
*/
|
|
|
|
|
public function statistic()
|
|
|
|
|
{
|
|
|
|
|
// 护工陪护
|
|
|
|
|
$paramedic = [
|
|
|
|
|
'total' => Paramedic::count(),
|
|
|
|
|
'has_accompany' => '',
|
|
|
|
|
'no_accompany' => '',
|
|
|
|
|
'accompany_order' => '',
|
|
|
|
|
'rate' => ''
|
|
|
|
|
];
|
|
|
|
|
// 床位陪护
|
|
|
|
|
$bed = [
|
|
|
|
|
'total' => Bed::count(),
|
|
|
|
|
'has_accompany' => '',
|
|
|
|
|
'no_accompany' => '',
|
|
|
|
|
'rate' => ''
|
|
|
|
|
];
|
|
|
|
|
// 陪护统计表
|
|
|
|
|
$project = Project::get();
|
|
|
|
|
foreach ($project as $item) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// 最新陪护单
|
|
|
|
|
$lastOrder = Orders::with('project')
|
|
|
|
|
->where('status', 0)
|
|
|
|
|
->orderBy('id', 'desc')
|
|
|
|
|
->limit(8)
|
|
|
|
|
->get();
|
|
|
|
|
// 最新出院信息
|
|
|
|
|
$outOrder = Orders::with('project')
|
|
|
|
|
->where('status', 100)
|
|
|
|
|
->orderBy('id', 'desc')
|
|
|
|
|
->limit(8)
|
|
|
|
|
->get();
|
|
|
|
|
// 最新投诉信息
|
|
|
|
|
$tip = [];
|
|
|
|
|
// 上月满意度评价分析
|
|
|
|
|
$satisfied = [];
|
|
|
|
|
// 本月营收分析
|
|
|
|
|
$income = [];
|
|
|
|
|
// 本月陪护订单
|
|
|
|
|
$monthAccompany = [];
|
|
|
|
|
return $this->ajaxSuccess('获取成功', compact('paramedic', 'bed', 'project',
|
|
|
|
|
'lastOrder', 'outOrder', 'tip', 'satisfied', 'income', 'monthAccompany'));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|