Ejemplo n.º 1
0
 /**
  * 
  * @return unknown_type
  */
 public function delete_event_apply_doc($id = NULL)
 {
     if ($this->get_method() != 'POST') {
         $this->send_response(405, NULL, '请求的方法不存在');
     }
     $data = $this->get_data();
     $doc = $data['doc'] ? $data['doc'] : array();
     if (count($doc) > 0) {
         foreach ($doc as $v) {
             if (empty($v['did'])) {
                 $this->send_response(400, NULL, '400609:信息id为空');
             }
         }
     } else {
         $this->send_response(400, NULL, '400609:doc为空');
     }
     $event_info = $this->model->get($id);
     if (!$event_info) {
         $this->send_response(400, NULL, '400602:活动不存在');
     }
     if ($event_info['organizer'] != $this->user_id) {
         $this->send_response(400, NULL, '400603:没有权限');
     }
     foreach ($doc as $v) {
         $this->model->deleteEventApplyDoc($v['did']);
     }
     $this->send_response(200);
 }