Example #1
0
 /**
  * 
  * @return none
  */
 public function done($id = NULL)
 {
     if ($this->get_method() != 'POST') {
         $this->send_response(405, NULL, '请求的方法不存在');
     }
     $data = $this->get_data();
     if (empty($id)) {
         $this->send_response(400, NULL, '401307:交易ID为空');
     }
     $id = (int) $id;
     $remark = $data['remark'] ? trim($data['remark']) : '';
     $status = $data['status'] == 1 ? 1 : 2;
     $deal = $this->model->get($id);
     if (!$deal) {
         $this->send_response(400, NULL, '401309:交易ID非法');
     }
     $letters = array('status' => $status, 'remark' => $remark);
     if ($this->model->update($id, $this->user_id, '', $letters)) {
         $this->send_response(200);
     }
     $this->send_response(400, NULL, '401310:交易更新失败');
 }