whj 4 lat temu
rodzic
commit
0efff38d3b

+ 5 - 3
app/Http/Controllers/Admin/ProjectUserRoleController.php

xqd xqd
@@ -67,7 +67,8 @@ class ProjectUserRoleController extends BaseController
     public function create()
     {
         $project_options = (new Project())->getOptions();
-        $role_options = (new ProjectRole())->getOptions();
+        $role_options = (new ProjectRole())->where('id','!=',6)->get()->toArray();
+        
         list($model, $model_name, $pre_uri) = array($this->model, $this->model_name, $this->pre_uri);
         return view($this->view_path . 'create', compact('model', 'model_name','pre_uri', 'role_options', 'project_options'));
     }
@@ -124,9 +125,10 @@ class ProjectUserRoleController extends BaseController
 
     public function edit(Request $request)
     {
-        if(empty($request->input('id')) || empty($item = $this->model->find($request->input('id')))) return back()->withErrors(['sg_error_info' => '找不到要编辑的数据']);
+        $id = request('id');
+        if(empty($id) || empty($item = $this->model->find($id))) return back()->withErrors(['sg_error_info' => '找不到要编辑的数据']);
         $project_options = (new Project())->getOptions();
-        $role_options = (new ProjectRole())->getOptions();
+        $role_options = (new ProjectRole())->where('id','!=',6)->get()->toArray();
         list($model, $model_name, $pre_uri) = array($this->model, $this->model_name, $this->pre_uri);
         return view($this->view_path . 'edit', compact('model', 'model_name', 'pre_uri', 'item', 'project_options', 'role_options'));
     }