作者 郭盛
1 个管道 的构建 通过 耗费 13 秒

修改编辑删除领域

@@ -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
@@ -9695,7 +9695,7 @@ @@ -9695,7 +9695,7 @@
9695 9695
9696 <div class="row mt0 footer"> 9696 <div class="row mt0 footer">
9697 <div class="col-md-6" align="left"> 9697 <div class="col-md-6" align="left">
9698 - Generated on 2020-03-26 17:12:24 </div> 9698 + Generated on 2020-03-27 09:13:29 </div>
9699 <div class="col-md-6" align="right"> 9699 <div class="col-md-6" align="right">
9700 <a href="https://www.fastadmin.net" target="_blank">FastAdmin</a> 9700 <a href="https://www.fastadmin.net" target="_blank">FastAdmin</a>
9701 </div> 9701 </div>