作者 曹东东

教师

@@ -96,6 +96,12 @@ class Teacher extends ManystoreBase @@ -96,6 +96,12 @@ class Teacher extends ManystoreBase
96 $this->error('工号已存在'); 96 $this->error('工号已存在');
97 } 97 }
98 98
  99 + if($this->model->where(['mobile' => $params['mobile'],'school_id' => SCHOOL_ID])->find()) {
  100 + $this->error('手机号已存在');
  101 + }
  102 + if($this->model->where(['email' => $params['email'],'school_id' => SCHOOL_ID])->find()) {
  103 + $this->error('邮箱已存在');
  104 + }
99 $result = false; 105 $result = false;
100 Db::startTrans(); 106 Db::startTrans();
101 try { 107 try {
@@ -343,6 +349,14 @@ class Teacher extends ManystoreBase @@ -343,6 +349,14 @@ class Teacher extends ManystoreBase
343 if($this->model->where(['job_num' => $params['job_num'],'school_id' => SCHOOL_ID])->where('id','neq',$row['id'])->find()) { 349 if($this->model->where(['job_num' => $params['job_num'],'school_id' => SCHOOL_ID])->where('id','neq',$row['id'])->find()) {
344 $this->error('工号已存在'); 350 $this->error('工号已存在');
345 } 351 }
  352 +
  353 + if($this->model->where(['mobile' => $params['mobile'],'school_id' => SCHOOL_ID])->where('id','neq',$row['id'])->find()) {
  354 + $this->error('手机号已存在');
  355 + }
  356 + if($this->model->where(['email' => $params['email'],'school_id' => SCHOOL_ID])->where('id','neq',$row['id'])->find()) {
  357 + $this->error('邮箱已存在');
  358 + }
  359 +
346 $result = false; 360 $result = false;
347 Db::startTrans(); 361 Db::startTrans();
348 if(!empty($params['password'])){ 362 if(!empty($params['password'])){