diff --git a/application/controllers/infofix.php b/application/controllers/infofix.php index a8a3ed2e..a77b82e7 100644 --- a/application/controllers/infofix.php +++ b/application/controllers/infofix.php @@ -16,6 +16,9 @@ class infofix extends CI_Controller header('Access-Control-Allow-Origin: *'); } + /** + * 根据关键词搜索信息 + */ function list_info_by_keys() { // 防止超时 @@ -114,6 +117,9 @@ class infofix extends CI_Controller echo json_encode($rs); } + /** + * 更新含有关键的信息 + */ function update_info_by_keys() { // json参数 @@ -186,9 +192,8 @@ class infofix extends CI_Controller } /** - * 无条件获取内容 + * 无条件获取信息内容 * @param mixed $ic_id - * @return void */ function get_by_icid($ic_id) { @@ -214,6 +219,9 @@ class infofix extends CI_Controller } } + /** + * 无条件更新信息内容 + */ function update_by_icid() { $ic_id = $this->input->get_post('ic_id'); @@ -221,5 +229,29 @@ class infofix extends CI_Controller $this->infoContents_model->force_update($ic_id, $ic_content); } + /** + * 列举使用旧版构建工具的信息,用于批量替换更新。 + * @param mixed $site + */ + function list_use_hb($site) + { + $rs = $this->infoContents_model->list_use_hb($site); + if ($rs) { + echo json_encode( + array( + 'state' => 0, + 'infos' => $rs, + ) + ); + } else { + echo json_encode( + array( + 'state' => -1, + 'msg' => 'not content by ' . $site + ) + ); + } + } + } //end of infofix \ No newline at end of file diff --git a/application/models/infoContents_model.php b/application/models/infoContents_model.php index c13ef3d0..c53b1c41 100644 --- a/application/models/infoContents_model.php +++ b/application/models/infoContents_model.php @@ -369,4 +369,24 @@ class InfoContents_model extends CI_Model return FALSE; } } + + public function list_use_hb($site) + { + $sql = " + SELECT c.ic_id, c.url + FROM infoContents c + INNER JOIN infoMetas m + ON c.ic_id = m.im_ic_id + WHERE m.im_key = 'AMP_BODY_PC_STATUS' + AND CONVERT(nvarchar(max), m.im_value) = 'yes' + AND c.ic_sitecode = ? + "; + $query = $this->HT->query($sql, array($site)); + $rs = $query->result(); + if ($rs) { + return $rs; + } else { + return FALSE; + } + } }