|
|
@@ -338,6 +338,11 @@ class Employee extends Controller
|
|
|
if ($other_company_user && $other_company_user->company_id != $all_data['company_id']) {
|
|
|
return json_send(['code' => 'error', 'msg' => '手机号码已绑定其它公司']);
|
|
|
}
|
|
|
+ //校验邮箱号码是否绑定其它公司
|
|
|
+ $other_company_user = $EmployeeModel->where(['email' => $all_data['email']])->first();
|
|
|
+ if ($other_company_user && $other_company_user->company_id != $all_data['company_id']) {
|
|
|
+ return json_send(['code' => 'error', 'msg' => '邮箱号码已绑定其它公司']);
|
|
|
+ }
|
|
|
$data = $EmployeeModel->where($map)->first();
|
|
|
if ($data) return json_send(['code' => 'error', 'msg' => '员工手机号记录已存在']);
|
|
|
// 写入数据表
|
|
|
@@ -412,6 +417,11 @@ class Employee extends Controller
|
|
|
if ($other_company_user && $other_company_user->company_id != $all_data['company_id']) {
|
|
|
return json_send(['code' => 'error', 'msg' => '手机号码已绑定其它公司']);
|
|
|
}
|
|
|
+ //校验邮箱号码是否绑定其它公司
|
|
|
+ $other_company_user = $EmployeeModel->where(['email' => $all_data['email']])->first();
|
|
|
+ if ($other_company_user && $other_company_user->company_id != $all_data['company_id']) {
|
|
|
+ return json_send(['code' => 'error', 'msg' => '邮箱号码已绑定其它公司']);
|
|
|
+ }
|
|
|
$data = $EmployeeModel->where($map)->where('id', '!=', $id)->first();
|
|
|
if ($data) return json_send(['code' => 'error', 'msg' => '员工手机号记录已存在']);
|
|
|
// 更新数据表
|