From bf74eebffbec06ee169d91c9c65a38b37b2a8c4b Mon Sep 17 00:00:00 2001 From: cyc Date: Wed, 24 Jun 2020 15:35:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0TA=E9=93=BE=E6=8E=A5=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=88=A0=E9=99=A4=E9=85=8D=E7=BD=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tripadvisor_spider/controllers/index.php | 9 +++ .../models/Tripadvisor_Review_model.php | 5 ++ .../views/third_party_input.php | 69 +++++++++++++++++-- 3 files changed, 79 insertions(+), 4 deletions(-) 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