diff --git a/application/third_party/tripadvisor_spider/controllers/index.php b/application/third_party/tripadvisor_spider/controllers/index.php index 869015c9..a01ee264 100644 --- a/application/third_party/tripadvisor_spider/controllers/index.php +++ b/application/third_party/tripadvisor_spider/controllers/index.php @@ -477,4 +477,13 @@ class Index extends CI_Controller { exit('请输入参数'); } } + + public function deleteconfig(){ + $configId = $this->input->get_post('config_id'); + + if(!empty($configId)){ + $this->Tripadvisor_Review_model->delete_config($configId); + } + + } } diff --git a/application/third_party/tripadvisor_spider/models/Tripadvisor_Review_model.php b/application/third_party/tripadvisor_spider/models/Tripadvisor_Review_model.php index 8dca3e9f..cf8e87d0 100644 --- a/application/third_party/tripadvisor_spider/models/Tripadvisor_Review_model.php +++ b/application/third_party/tripadvisor_spider/models/Tripadvisor_Review_model.php @@ -226,4 +226,9 @@ class Tripadvisor_Review_model extends CI_Model { $query = $this->INFO->query($sql,array($destination)); return $query->result(); } + + public function delete_config($id){ + $sql = "delete from Ta_Reviews_Config where trc_id = ?"; + $query = $this->INFO->query($sql,array($id)); + } } diff --git a/application/third_party/tripadvisor_spider/views/third_party_input.php b/application/third_party/tripadvisor_spider/views/third_party_input.php index 23daf969..5fefb3a2 100644 --- a/application/third_party/tripadvisor_spider/views/third_party_input.php +++ b/application/third_party/tripadvisor_spider/views/third_party_input.php @@ -7,7 +7,7 @@
-
+
@@ -132,7 +132,7 @@
-
+
+ + + + + +
+ +
+
+
+
@@ -277,6 +295,31 @@ $(function(){ } }); + //查询配置信息 + $('#searchconfig').on('click',function(){ + var destination = $('#search_confg_destination').val(); + if(destination != ''){ + $.ajax({ + url : '/info.php/apps/tripadvisor_spider/index/get_production_code', + data : {destination : destination}, + type:'POST', + success : function (json,status){ + var jsondata = $.parseJSON(json); + var config_html = ''; + for (var i=0;i'; + config_html += '
'+jsondata[i].trc_code+'
'; + config_html += '
'+jsondata[i].trc_links+'
'; + config_html += '

'; + } + $('#config_result').html(config_html); + } + }); + } + }); + + //excel导出抓取 $('#contentbyexcel').click(function(){ var fileArray = document.getElementById("file_excel").files; @@ -424,4 +467,22 @@ $(function(){ }); }); + +function deleteconfig(id){ + if(id != ''){ + $.ajax({ + url : '/info.php/apps/tripadvisor_spider/index/deleteconfig/', + data : { + config_id : id + }, + type:'POST', + success:function(){ + alert('配置已删除'); + window.location.reload(); + } + }); + } +} + + \ No newline at end of file