public function verify() { $res = array(); $res['Success'] = false; if ($this->Action > 1) { //不通过,删除操作 $hours = new Hours(); $hours->Id = $this->Id; $result = $hours->delete(); if ($result > 0) { $res['Success'] = true; $res['Message'] = "删除成功"; } else { $res['Message'] = "删除失败"; } } else { //通过,计入项目总工时 $hours = new Hours(); $hours->Id = $this->Id; $hours->Ratio = $this->Ratio; $hours->Hours2 = $this->Hours2; $result = $hours->update(); if ($result > 0) { //审核成功 $project = new Project(); $project->setValue($this->ProjectId); $project->Hours = $project->Hours + $hours->Hours2; $project->update(); $res['Success'] = true; $res['Message'] = "审核通过"; $res['NewId'] = $this->Id; } else { $res['Success'] = false; $res['Message'] = "审核失败"; } } echo json_encode($res); exit; }