|
@@ -185,7 +185,7 @@ class EmployeeService extends Service
|
|
|
// if($this->isEmpty($data,'title')) return [201,'名称不存在!'];
|
|
|
list($status,$msg) = $this->departRule($data);
|
|
|
if(!$status) return [$status,$msg];
|
|
|
- $first = Depart::where('title',$data['title'])->where('id','<>',$data['id'])->where('del_time',0)->first();
|
|
|
+ $first = Depart::where('title',$data['title'])->where('del_time',0)->first();
|
|
|
if(!empty($first))return [false,'名称已存在!'];
|
|
|
|
|
|
$model = new Depart();
|
|
@@ -219,6 +219,7 @@ class EmployeeService extends Service
|
|
|
|
|
|
public function departRule($data){
|
|
|
if($this->isEmpty($data,'title')) return [false,'名称不存在!'];
|
|
|
+ if($this->isEmpty($data,'code')) return [false,'编码不存在!'];
|
|
|
|
|
|
return [true,''];
|
|
|
}
|