/** * * 取消备份 */ public function cancel_backup() { $data = $this->get_data(); $device_id = $data['device_id'] ? trim($data['device_id']) : ''; $batch_number = $data['batch_number'] ? trim($data['batch_number']) : ''; if (empty($device_id)) { $this->send_response(400, NULL, '401201:设备id为空'); } if (empty($batch_number)) { $this->send_response(400, NULL, '401204:备份批号为空'); } $batch_info = $this->model->get_batch_info($this->user_id, $device_id, $batch_number); if (!$batch_info) { $this->send_response(400, NULL, '401213:备份批号非法'); } $total_sms = $this->model->cancel_backup($this->user_id, $device_id, $batch_number); if ($total_sms) { $this->send_response(200, array('batch_total_sms' => $total_sms)); } $this->send_response(400, NULL, '401215:取消备份失败'); }