예제 #1
0
 /**
  * 删除串联单
  * @name delete
  * @access public
  * @author lijiaying
  * @category hogesoft
  * @copyright hogesoft
  * @param $id int 串联单ID
  * @return $ret int 被删除串联单ID
  * @include tvie_api.php
  */
 public function delete()
 {
     $id = intval($this->input['id']);
     if (!$id) {
         $this->errorOutput('为传入串联单ID');
     } else {
         $sql = "SELECT epg_id FROM " . DB_PREFIX . "channel_chg_plan WHERE id=" . $id;
         $epg = $this->db->query_first($sql);
         if ($this->settings['tvie']['open']) {
             include CUR_CONF_PATH . 'lib/tvie_api.php';
             $tvie_api = new TVie_api($this->settings['tvie']['up_stream_server']);
             $ret_del = $tvie_api->delete_channel_epg($epg['epg_id']);
             if (!$ret_del['result']) {
                 $this->errorOutput('删除失败');
             }
         }
         $sql = "DELETE FROM " . DB_PREFIX . "channel_chg_plan WHERE id=" . $id;
         $this->db->query($sql);
     }
     $ret['id'] = $id;
     $this->addItem($ret);
     $this->output();
 }