From 2a644367ca68595dc41fab56e4f8fb7be85f0d48 Mon Sep 17 00:00:00 2001 From: lmrwork <59361885@qq.com> Date: Thu, 21 Jun 2018 11:13:35 +0800 Subject: [PATCH] amp_check --- application/controllers/tools.php | 23 +++++ application/models/infoMetas_model.php | 23 +++++ application/views/tools/amp_check.php | 130 +++++++++++++++++++++++++ 3 files changed, 176 insertions(+) create mode 100644 application/views/tools/amp_check.php diff --git a/application/controllers/tools.php b/application/controllers/tools.php index ac95ded2..723c8d44 100644 --- a/application/controllers/tools.php +++ b/application/controllers/tools.php @@ -11,6 +11,7 @@ class Tools extends CI_Controller $this->load->model('Area_model'); $this->load->model('InfoStructures_model'); $this->load->model('Information_model'); + $this->load->model('InfoMetas_model'); $this->site_code = $this->config->item('site_code'); } @@ -52,6 +53,28 @@ class Tools extends CI_Controller $this->load->view('tools/old', $data); } } + + /** + * + * 公有函数:AMP转化表格。 + * + * 必要参数: + * @param String $site_code + * + */ + public function amp_check() + { + $data['amp'] = $this->input->get_post('amp'); + //AMP转化列表 + if ($data['amp'] == 'yes') { + $data['info'] = $this->InfoMetas_model->list_amp($this->site_code); + } else { + $data['info'] = $this->InfoMetas_model->list_no_amp($this->site_code); + } + + //视图 + $this->load->view('tools/amp_check', $data); + } /** * 导出CSV文件 diff --git a/application/models/infoMetas_model.php b/application/models/infoMetas_model.php index d95b1def..463266f7 100644 --- a/application/models/infoMetas_model.php +++ b/application/models/infoMetas_model.php @@ -40,6 +40,7 @@ class InfoMetas_model extends CI_Model { SELECT im.im_id ,im.im_ic_id ,c.ic_url + ,c.ic_id FROM infoMetas im inner join infoContents c on c.ic_id = im.im_ic_id @@ -55,6 +56,28 @@ class InfoMetas_model extends CI_Model { return $query->result(); } + //列表所有不含AMPmeta的信息。 + public function list_no_amp($site_code) { + $sql = " + SELECT im.im_id + ,im.im_ic_id + ,c.ic_url + ,c.ic_id + FROM infoMetas im + inner join infoContents c + on c.ic_id = im.im_ic_id + left join infoMetas im2 + on im2.im_ic_id = im.im_ic_id and im2.im_key = 'AMP_STATUS' + left join infoMetas im3 + on im3.im_ic_id = im.im_ic_id and im2.im_key = 'AMP_SCHEMA' + WHERE im.im_key = 'AMP_JSON' + and c.ic_sitecode = ? + and CONVERT(varchar, im2.im_value) <> '1' + "; + $query = $this->HT->query($sql, array($site_code)); + return $query->result(); + } + //按节点列表信息(含meta数据) function list_info_by_path_with_meta($is_path, $site_code) { $sql = "SELECT is1.is_id, \n" diff --git a/application/views/tools/amp_check.php b/application/views/tools/amp_check.php new file mode 100644 index 00000000..7e42a8f1 --- /dev/null +++ b/application/views/tools/amp_check.php @@ -0,0 +1,130 @@ + + + +老旧信息-v1.0 + + + + + + + + +
+
+ +
+
+ + + + + + + + + + + $it) { + if ($key == 800) break; + ?> + + + + + + + + +
#文件名发布
ic_url);?> + 是'); + else + echo(''); + ?> + + 编辑 +
+
+
+
+ +
+ + \ No newline at end of file