|
...
|
...
|
@@ -69,15 +69,16 @@ class OnlineCheckLogic extends BaseLogic |
|
|
|
*/
|
|
|
|
public function saveOnlineCheck(){
|
|
|
|
$info = $this->model->read(['project_id'=>$this->param['id']]);
|
|
|
|
$projectModel = new Project();
|
|
|
|
if($info !== false){
|
|
|
|
$this->fail('已提交,请勿重复提交');
|
|
|
|
$projectInfo = $projectModel->read(['id'=>$this->param['id']],['id','status']);
|
|
|
|
if($projectInfo['status'] != $projectModel::STATUS_ONE){
|
|
|
|
$projectModel->edit(['status'=>$projectModel::STATUS_ONE],['id'=>$projectInfo['id']]);
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
if(($this->param['optimist_mid'] == 0) || ($this->param['qa_mid'] == 0)){
|
|
|
|
$this->fail('请先选择优化师和品控,在提交审核');
|
|
|
|
}
|
|
|
|
$projectModel = new Project();
|
|
|
|
//提交审核修改状态为审核中
|
|
|
|
$projectModel->edit(['status'=>1],['id'=>$this->param['id']]);
|
|
|
|
//组装数据
|
|
|
|
$data = [
|
|
|
|
'project_id' => $this->param['id'],
|
|
...
|
...
|
@@ -86,9 +87,11 @@ class OnlineCheckLogic extends BaseLogic |
|
|
|
'qa_mid' => $this->param['qa_mid'],
|
|
|
|
'created_at'=>date('Y-m-d H:i:s')
|
|
|
|
];
|
|
|
|
$rs = $this->model->add($data);
|
|
|
|
if($rs === false){
|
|
|
|
$this->fail('error');
|
|
|
|
try {
|
|
|
|
$projectModel->edit(['status'=>$projectModel::STATUS_ONE],['id'=>$this->param['id']]);
|
|
|
|
$this->model->add($data);
|
|
|
|
}catch (\Exception $e){
|
|
|
|
$this->fail('提交失败,请联系开发人员');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $this->success();
|
...
|
...
|
|