|
|
|
|
@ -300,6 +300,8 @@ class ProjectController extends CommonController
|
|
|
|
|
public function askSubmit()
|
|
|
|
|
{
|
|
|
|
|
$userId = auth()->id();
|
|
|
|
|
$project_id = \request('project_id');
|
|
|
|
|
|
|
|
|
|
// 判断是否护士长
|
|
|
|
|
$roleId = Role::where('name', 'like', '%护士长%')->where('guard_name', 'admin')->value('id');
|
|
|
|
|
$hushizhang = DB::table('model_has_roles')->where('role_id', $roleId)
|
|
|
|
|
@ -307,11 +309,15 @@ class ProjectController extends CommonController
|
|
|
|
|
->where('model_id', $userId)->count();
|
|
|
|
|
|
|
|
|
|
$data = AskSubmit::with("admin", "project")
|
|
|
|
|
->where(function ($qeury) use ($hushizhang, $userId) {
|
|
|
|
|
->where(function ($qeury) use ($hushizhang, $userId, $project_id) {
|
|
|
|
|
if ($hushizhang) $qeury->where('admin_id', $userId);
|
|
|
|
|
if ($project_id) $qeury->where('project_id', $project_id);
|
|
|
|
|
})->paginate(10);
|
|
|
|
|
|
|
|
|
|
return view($this->bladePath . ".asksubmit_index", compact("data"));
|
|
|
|
|
$projects = (new StatisticsController())->_checkProjects();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return view($this->bladePath . ".asksubmit_index", compact("data", "projects"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|