|
@@ -488,15 +488,30 @@ class Teacher extends Api |
|
@@ -488,15 +488,30 @@ class Teacher extends Api |
488
|
$this->error($validate->getError());
|
488
|
$this->error($validate->getError());
|
489
|
}
|
489
|
}
|
490
|
$param['updatetime'] = time();
|
490
|
$param['updatetime'] = time();
|
491
|
- $info = Db::name('territory')
|
491
|
+
|
|
|
492
|
+ $res = Db::name('territory')
|
492
|
->where('id',$param['id'])
|
493
|
->where('id',$param['id'])
|
493
|
- ->update($param);
|
|
|
494
|
- if(empty($info)){
|
|
|
495
|
- $this->error('sql执行错误');
|
494
|
+ ->find();
|
|
|
495
|
+ if($res['is_check'] == 1){
|
|
|
496
|
+ $info = Db::name('territory')
|
|
|
497
|
+ ->where('id',$param['id'])
|
|
|
498
|
+ ->update($param);
|
|
|
499
|
+ if(empty($info)){
|
|
|
500
|
+ $this->error('sql执行错误');
|
|
|
501
|
+ }else{
|
|
|
502
|
+ $a = Db::name('territory')->where('id',$param['id'])->find();
|
|
|
503
|
+ Db::name('teacher')->where('user_id',$a['user_id'])->update(['status'=>0]);
|
|
|
504
|
+ $this->success('SUCCESS');
|
|
|
505
|
+ }
|
496
|
}else{
|
506
|
}else{
|
497
|
- $a = Db::name('territory')->where('id',$param['id'])->find();
|
|
|
498
|
- Db::name('teacher')->where('user_id',$a['user_id'])->update(['status'=>0]);
|
|
|
499
|
- $this->success('SUCCESS');
|
507
|
+ $info = Db::name('territory')
|
|
|
508
|
+ ->where('id',$param['id'])
|
|
|
509
|
+ ->update($param);
|
|
|
510
|
+ if(empty($info)){
|
|
|
511
|
+ $this->error('sql执行错误');
|
|
|
512
|
+ }else{
|
|
|
513
|
+ $this->success('SUCCESS');
|
|
|
514
|
+ }
|
500
|
}
|
515
|
}
|
501
|
}
|
516
|
}
|
502
|
|
517
|
|