Beispiel #1
0
 public function removeAction()
 {
     // 返回值数组
     $result = array('success' => true, 'result' => true, 'info' => '删除成功');
     $user_session = new Zend_Session_Namespace('user');
     $user = $user_session->user_info['employee_id'];
     $now = date('Y-m-d H:i:s');
     $task = new User_Model_Task();
     // Content-Type:application/json 不能直接到request里面读取
     $request_body = file_get_contents('php://input');
     $json = json_decode($request_body);
     try {
         if ($json->EventId) {
             $this->send($json->EventId, 'delete');
             $task->delete("id=" . $json->EventId);
         }
     } catch (Exception $e) {
         $result['result'] = false;
         $result['info'] = $e->getMessage();
         echo Zend_Json::encode($result);
         exit;
     }
     echo Zend_Json::encode($result);
     exit;
 }