正在显示
1 个修改的文件
包含
10 行增加
和
7 行删除
| @@ -69,15 +69,16 @@ class OnlineCheckLogic extends BaseLogic | @@ -69,15 +69,16 @@ class OnlineCheckLogic extends BaseLogic | ||
| 69 | */ | 69 | */ |
| 70 | public function saveOnlineCheck(){ | 70 | public function saveOnlineCheck(){ |
| 71 | $info = $this->model->read(['project_id'=>$this->param['id']]); | 71 | $info = $this->model->read(['project_id'=>$this->param['id']]); |
| 72 | + $projectModel = new Project(); | ||
| 72 | if($info !== false){ | 73 | if($info !== false){ |
| 73 | - $this->fail('已提交,请勿重复提交'); | 74 | + $projectInfo = $projectModel->read(['id'=>$this->param['id']],['id','status']); |
| 75 | + if($projectInfo['status'] != $projectModel::STATUS_ONE){ | ||
| 76 | + $projectModel->edit(['status'=>$projectModel::STATUS_ONE],['id'=>$projectInfo['id']]); | ||
| 77 | + } | ||
| 74 | }else{ | 78 | }else{ |
| 75 | if(($this->param['optimist_mid'] == 0) || ($this->param['qa_mid'] == 0)){ | 79 | if(($this->param['optimist_mid'] == 0) || ($this->param['qa_mid'] == 0)){ |
| 76 | $this->fail('请先选择优化师和品控,在提交审核'); | 80 | $this->fail('请先选择优化师和品控,在提交审核'); |
| 77 | } | 81 | } |
| 78 | - $projectModel = new Project(); | ||
| 79 | - //提交审核修改状态为审核中 | ||
| 80 | - $projectModel->edit(['status'=>1],['id'=>$this->param['id']]); | ||
| 81 | //组装数据 | 82 | //组装数据 |
| 82 | $data = [ | 83 | $data = [ |
| 83 | 'project_id' => $this->param['id'], | 84 | 'project_id' => $this->param['id'], |
| @@ -86,9 +87,11 @@ class OnlineCheckLogic extends BaseLogic | @@ -86,9 +87,11 @@ class OnlineCheckLogic extends BaseLogic | ||
| 86 | 'qa_mid' => $this->param['qa_mid'], | 87 | 'qa_mid' => $this->param['qa_mid'], |
| 87 | 'created_at'=>date('Y-m-d H:i:s') | 88 | 'created_at'=>date('Y-m-d H:i:s') |
| 88 | ]; | 89 | ]; |
| 89 | - $rs = $this->model->add($data); | ||
| 90 | - if($rs === false){ | ||
| 91 | - $this->fail('error'); | 90 | + try { |
| 91 | + $projectModel->edit(['status'=>$projectModel::STATUS_ONE],['id'=>$this->param['id']]); | ||
| 92 | + $this->model->add($data); | ||
| 93 | + }catch (\Exception $e){ | ||
| 94 | + $this->fail('提交失败,请联系开发人员'); | ||
| 92 | } | 95 | } |
| 93 | } | 96 | } |
| 94 | return $this->success(); | 97 | return $this->success(); |
-
请 注册 或 登录 后发表评论