Example #1
0
 /**
  * 
  * 申请备份批号
  */
 public function apply_batch_number()
 {
     $data = $this->get_data();
     $device_id = $data['device_id'] ? trim($data['device_id']) : '';
     $phone_model = $data['phone_model'] ? trim($data['phone_model']) : '';
     $total_sms = $data['total_sms'] ? trim($data['total_sms']) : 0;
     if (empty($device_id)) {
         $this->send_response(400, NULL, '401201:设备id为空');
     }
     if (empty($total_sms)) {
         $this->send_response(400, NULL, '401202:总短信条数为空');
     }
     $number = $this->model->apply_batch_number($this->user_id, $device_id, $phone_model, $total_sms, $this->appid, $this->source);
     if ($number) {
         $this->send_response(200, array('batch_number' => $number));
     }
     $this->send_response(400, NULL, '401203:申请备份批号失败');
 }