Browse Source

[智价云] 员工所属部门更新

tangyuanwang 11 hours ago
parent
commit
77fbcaac70

+ 2 - 2
app/Http/Controllers/Manager/Personnel/Employee.php

@@ -227,7 +227,7 @@ class Employee extends Controller
         $all_data = request()->all();
         //查询是否存在
         $map = ['name' => $all_data['name']];
-        $department_ids =  request('department_id', '');
+        $department_ids =  request('department_ids', '');
         $all_data['department_ids'] = $department_ids;
         $city_ids =  request('city_ids', '');
         $all_data['city_ids'] = $city_ids;
@@ -258,7 +258,7 @@ class Employee extends Controller
         $id         = request('id', 0);
         // 接收数据
         $all_data = request()->all();
-        $department_ids =  request('department_id', '');
+        $department_ids =  request('department_ids', '');
         $all_data['department_ids'] = $department_ids;
         $city_ids =  request('city_ids', '');
         $all_data['city_ids'] = $city_ids;

+ 4 - 2
app/Http/Requests/Manager/Personnel/Employee.php

@@ -35,6 +35,7 @@ class Employee extends BaseRequest
             'role_id'           => 'required|integer|gt:0',
             'password'          => 'required',
             'open_notice'       => 'required|integer|in:0,1',
+            'department_ids'    => 'required',
         ];
     }
 
@@ -43,8 +44,8 @@ class Employee extends BaseRequest
     protected   $scenes         = [
         'detail'             => ['id'],
         'list'               => ['page', 'limit'],
-        'add'                      => ['name', 'mobile','department_id','role_id','password','open_notice'],
-        'edit'                  => ['id','name', 'mobile','department_id','role_id','open_notice'],
+        'add'                      => ['name', 'mobile','department_ids','role_id','password','open_notice'],
+        'edit'                  => ['id','name', 'mobile','department_ids','role_id','open_notice'],
         'set_status'              => ['id', 'status'],
         'delete'                  => ['id'],
         'all'                    => [''],
@@ -85,6 +86,7 @@ class Employee extends BaseRequest
             'open_notice.required'    => '通知未知',
             'open_notice.integer'     => '通知格式错误',
             'open_notice.in'          => '通知格式错误',
+            'department_ids.required' => '部门未知',
         ];
     }
 }