コード例 #1
0
ファイル: demo.php プロジェクト: xuyintao/thindev
 public function verify()
 {
     $res = array();
     $res['Success'] = false;
     if ($this->Action > 1) {
         //不通过,删除操作
         $obj = new Demo();
         $obj->Id = $this->Id;
         $result = $obj->delete();
         if ($result > 0) {
             $res['Success'] = true;
             $res['Message'] = "删除成功";
         } else {
             $res['Message'] = "删除失败";
         }
     } else {
         //通过,计入项目总工时
         $obj = new Demo();
         $obj->Id = $this->Id;
         $obj->Ratio = $this->Ratio;
         $obj->Hours2 = $this->Hours2;
         $result = $obj->update();
         if ($result > 0) {
             $res['Success'] = true;
             $res['Message'] = "审核通过";
             $res['NewId'] = $this->Id;
         } else {
             $res['Success'] = false;
             $res['Message'] = "审核失败";
         }
     }
     echo json_encode($res);
     exit;
 }