Exemple #1
0
 /**
  * 
  * @return unknown_type
  */
 public function update_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为空');
             }
             if (empty($v['title'])) {
                 $this->send_response(400, NULL, '400606:标题为空');
             }
         }
     } 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->updateEventApplyDoc($v['did'], $v['title']);
     }
     $this->send_response(200);
 }