diff --git a/application/config/config.php b/application/config/config.php index df5cd0d1..bc6fe541 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -382,6 +382,7 @@ $config['site'] = array( 'mct' => array('site_code' => 'mct', 'site_id' => 6, 'site_lgc' => '101', 'site_image_url' => '', 'site_url' => 'https://www.mychinatours.com', 'site_authors' => array('cj')), 'diy' => array('site_code' => 'diy', 'site_id' => 99, 'site_lgc' => '1', 'sitemap_name' => 'E:/Dropbox/wwwroot/diychinatours.com/information.sitemap.xml', 'site_image_url' => '//images.diychinatours.com', 'site_url' => 'http://www.diychinatours.com', 'site_sitemap' => 'E:/Dropbox/wwwroot/diychinatours.com/information.sitemap.xml', 'site_authors' => array('ycc,lyy')), 'ah' => array('site_code' => 'ah', 'site_id' => 141, 'site_lgc' => '1', 'sitemap_name' => '', 'site_image_url' => '//images.asiahighlights.com', 'site_url' => 'https://www.asiahighlights.com', 'site_sitemap' => '', 'site_authors' => array('X', 'sfx'), 'site_user' => array(',ycc,sfx,X,')), + 'pgr' => array('site_code' => 'pgr', 'site_id' => 0, 'site_lgc' => '2', 'sitemap_name' => '', 'site_image_url' => '', 'site_url' => '', 'site_sitemap' => '', 'site_authors' => array('X', 'sfx'), 'site_user' => array(',ycc,sfx,X,')), 'bht' => array('site_code' => 'bht', 'site_id' => 6565, 'site_lgc' => '1', 'site_image_url' => '', 'site_url' => 'http://www.beijinghighlights.com', 'site_authors' => array('cj')) ); diff --git a/application/controllers/amp.php b/application/controllers/amp.php new file mode 100644 index 00000000..e24c449a --- /dev/null +++ b/application/controllers/amp.php @@ -0,0 +1,62 @@ +permission->is_admin(); + //$this->output->enable_profiler(TRUE); + $this->load->model('Information_model'); + $this->load->model('InfoMetas_model'); + } + + public function index() { + $data = array(); + $this->load->view('bootstrap3/header', $data); + $this->load->view('amp_editor'); + $this->load->view('bootstrap3/footer'); + } + + public function edit($ic_id) { + $data = array(); + $data['information'] = $this->Information_model->detail_by_ic_id($ic_id); + if ($data['information'] == FALSE) { + show_404(); + } + $this->load->view('bootstrap3/header', $data); + $this->load->view('amp_editor'); + $this->load->view('bootstrap3/footer'); + } + + public function edit_save() { + $data = array(); + $ic_id = $this->input->post('ic_id'); + $textarea_htmlcode = $this->input->post('textarea_htmlcode'); + $amp_status = $this->input->post('amp_status'); + $data['information'] = $this->Information_model->detail_by_ic_id($ic_id); + if ($data['information'] == FALSE) { + show_404(); + } + + $amp = $this->InfoMetas_model->get($ic_id, 'AMP'); + if ($amp === false) { + $this->InfoMetas_model->add($ic_id, 'AMP', $textarea_htmlcode); + } else { + $this->InfoMetas_model->update($ic_id, 'AMP', $textarea_htmlcode); + } + + $amp_status_value = $this->InfoMetas_model->get($ic_id, 'AMP_STATUS'); + if ($amp_status_value === false) { + $this->InfoMetas_model->add($ic_id, 'AMP_STATUS', $amp_status); + } else { + $this->InfoMetas_model->update($ic_id, 'AMP_STATUS', $amp_status); + } + + $data[] = array('name' => 'ok', 'value' => $this->lang->line('form_info_success')); + echo json_encode($data); + } + +} diff --git a/application/controllers/keyworlds.php b/application/controllers/keyworlds.php index 0493cb43..2867c7ba 100644 --- a/application/controllers/keyworlds.php +++ b/application/controllers/keyworlds.php @@ -341,10 +341,10 @@ class Keyworlds extends CI_Controller { // rank 变化 if ($client_flag === 'PC') { $this->Keywords_model->update_time($kw_id); - $last_rank_pc = $this->Keywordsrank_model->get_last_pc_rank($kw_id); - if (trim($last_rank_pc[0]->kwr_rank) != "") { + $last_rank_pc = $this->Keywordsrank_model->get_last_pc_rank($kw_id, 2); + if (trim($last_rank_pc[1]->kwr_rank) != "") { $this->load->model('InfoSMS_model'); - $last_rank_pc = isset($last_rank_pc[0]) ? $last_rank_pc[0]->kwr_rank : $rank['rank']; + $last_rank_pc = isset($last_rank_pc[1]) ? $last_rank_pc[1]->kwr_rank : $rank['rank']; $this->InfoSMS_model->readed_for_info($kw_id, 'keywords_rank'); $this->InfoSMS_model->add('keywords_rank', $kw_id, $rank['rank'], $last_rank_pc, (string) ($rank['rank'] - $last_rank_pc)); } @@ -429,10 +429,10 @@ class Keyworlds extends CI_Controller { // rank 变化 if ($client_flag === 'PC') { $this->Keywords_model->update_time($v->kw_id); - $last_rank_pc = $this->Keywordsrank_model->get_last_pc_rank($v->kw_id); - if (trim($last_rank_pc[0]->kwr_rank) != "") { + $last_rank_pc = $this->Keywordsrank_model->get_last_pc_rank($v->kw_id, 2); + if (trim($last_rank_pc[1]->kwr_rank) != "") { $this->load->model('InfoSMS_model'); - $last_rank_pc = isset($last_rank_pc[0]) ? $last_rank_pc[0]->kwr_rank : $rank['rank']; + $last_rank_pc = isset($last_rank_pc[1]) ? $last_rank_pc[1]->kwr_rank : $rank['rank']; $this->InfoSMS_model->readed_for_info($v->kw_id, 'keywords_rank'); $this->InfoSMS_model->add('keywords_rank', $v->kw_id, $rank['rank'], $last_rank_pc, (string) ($rank['rank'] - $last_rank_pc)); } diff --git a/application/models/infokeywordsrank_model.php b/application/models/infokeywordsrank_model.php index df0c8039..7c4e31c2 100644 --- a/application/models/infokeywordsrank_model.php +++ b/application/models/infokeywordsrank_model.php @@ -64,7 +64,7 @@ class infoKeywordsrank_model extends CI_Model } public function get_last_pc_rank($kw_id_string, $top=1) { - $sql = "SELECT top 2 kwr_id, + $sql = "SELECT top $top kwr_id, kwr_kw_id, kwr_rank, kwr_mobile_rank, diff --git a/application/views/amp_editor.php b/application/views/amp_editor.php new file mode 100644 index 00000000..8f938f25 --- /dev/null +++ b/application/views/amp_editor.php @@ -0,0 +1,91 @@ + + + +
+
+
+
+
+
+
+ + + +
+ +
+ + +
+
+ +
+
+
+
+
+
+ + + + + + + + + diff --git a/application/views/bootstrap3/information_edit.php b/application/views/bootstrap3/information_edit.php index 9409aae5..70098812 100644 --- a/application/views/bootstrap3/information_edit.php +++ b/application/views/bootstrap3/information_edit.php @@ -1,4 +1,4 @@ - + \ No newline at end of file