TODO: ADD PHOTO

master
LMR 11 months ago
parent e18119206c
commit c18fba5278

@ -169,28 +169,30 @@ class infofix extends CI_Controller {
return false; return false;
} }
// ic_content // ic_info
$ic = $this->infoContents_model->get_ic_contents2($ic_id); $ic = $this->infoContents_model->get_ic_contents2($ic_id);
if (! empty($ic)) { if (! empty($ic)) {
$ic->ic_content = str_ireplace($oldStr, $newStr, $ic->ic_content); $ic->ic_content = str_ireplace($oldStr, $newStr, $ic->ic_content);
$this->infoContents_model->force_update($ic_id, $ic->ic_content); $this->infoContents_model->force_update($ic_id, $ic->ic_content);
$ic->ic_url = str_ireplace($oldStr, $newStr, $ic->ic_url); $ic->ic_url = str_ireplace($oldStr, $newStr, $ic->ic_url);
$this->infoContents_model->force_update_url($ic_id, $ic->ic_url); $this->infoContents_model->force_update_url($ic_id, $ic->ic_url);
$ic->ic_photo = str_ireplace($oldStr, $newStr, $ic->ic_photo);
$this->infoContents_model->force_update_ic_photo($ic_id, $ic->ic_photo);
} }
// amp_json // amp_json
$meta = $this->infoMetas_model->get($ic_id, 'AMP_JSON'); // $meta = $this->infoMetas_model->get($ic_id, 'AMP_JSON');
if (! empty($meta)) { // if (! empty($meta)) {
$meta = str_ireplace($oldStr, $newStr, $meta); // $meta = str_ireplace($oldStr, $newStr, $meta);
$this->infoMetas_model->update($ic_id, 'AMP_JSON', $meta); // $this->infoMetas_model->update($ic_id, 'AMP_JSON', $meta);
} // }
// amp_body_pc // amp_body_pc
$meta = $this->infoMetas_model->get($ic_id, 'AMP_BODY_PC'); // $meta = $this->infoMetas_model->get($ic_id, 'AMP_BODY_PC');
if (! empty($meta)) { // if (! empty($meta)) {
$meta = str_ireplace($oldStr, $newStr, $meta); // $meta = str_ireplace($oldStr, $newStr, $meta);
$this->infoMetas_model->update($ic_id, 'AMP_BODY_PC', $meta); // $this->infoMetas_model->update($ic_id, 'AMP_BODY_PC', $meta);
} // }
echo json_encode($keyArr); echo json_encode($keyArr);

@ -1,36 +1,81 @@
<?php <?php
class InfoContents_model extends CI_Model class InfoContents_model extends CI_Model {
{
var $insert_id = -1; var $insert_id = -1;
function __construct() function __construct() {
{ parent::__construct();
parent::__construct(); $this->HT = $this->load->database('INFORMATION', TRUE);
$this->HT = $this->load->database('INFORMATION', TRUE); }
}
public function add_use_ORM($table, $data) public function add_use_ORM($table, $data) {
{ if ($this->HT->insert($table, $data)) {
if ($this->HT->insert($table, $data)) { return $this->HT->last_id($table);
return $this->HT->last_id($table); } else {
} else { return false;
return false;
}
} }
}
public function update_use_ORM($table, $data, $where) public function update_use_ORM($table, $data, $where) {
{ $this->HT->update($table, $data, $where);
$this->HT->update($table, $data, $where); }
}
function Add( function Add(
$ic_url,
$ic_url_title,
$ic_type,
$ic_title,
$ic_content,
$ic_summary,
$ic_seo_title,
$ic_seo_description,
$ic_seo_keywords,
$ic_show_bread_crumbs,
$ic_status,
$ic_template,
$ic_photo,
$ic_photo_width,
$ic_photo_height,
$ic_recommend_tours,
$ic_recommend_packages,
$ic_ht_area_id,
$ic_ht_area_type,
$ic_ht_product_id,
$ic_ht_product_type,
$ic_author
) {
$ic_content = str_replace('http:' . $this->config->item('site_image_url'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url_remote2'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url_org'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url2'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url_remote'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url3'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url_org2'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace('#textarea#', 'textarea', $ic_content);
$ic_content = str_replace('t_e_x_t_a_r_e_a', 'textarea', $ic_content);
$sql = "INSERT INTO infoContents \n"
. " ( \n"
. " ic_url, ic_url_title, ic_type, ic_title, ic_content, ic_summary, ic_seo_title, \n"
. " ic_seo_description, ic_seo_keywords, ic_show_bread_crumbs, ic_status, \n"
. " ic_template, ic_photo,ic_photo_width,ic_photo_height, ic_sitecode, ic_recommend_tours, ic_recommend_packages, \n"
. " ic_ht_area_id, ic_ht_area_type,ic_ht_product_id,ic_ht_product_type,ic_author, ic_datetime \n"
. " ) \n"
. "VALUES \n"
. " ( N?,N?,?,N?,N?,N?,N?,N?,N?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,getdate() )";
$query = $this->HT->query(
$sql,
[
$ic_url, $ic_url,
$ic_url_title, $ic_url_title,
$ic_type, $ic_type,
$ic_title, $ic_title,
$ic_content, str_replace(
$this->config->item('media_image_url'),
$this->config->item('site_image_url'),
$ic_content
),
$ic_summary, $ic_summary,
$ic_seo_title, $ic_seo_title,
$ic_seo_description, $ic_seo_description,
@ -41,75 +86,79 @@ class InfoContents_model extends CI_Model
$ic_photo, $ic_photo,
$ic_photo_width, $ic_photo_width,
$ic_photo_height, $ic_photo_height,
$this->config->item('site_code'),
$ic_recommend_tours, $ic_recommend_tours,
$ic_recommend_packages, $ic_recommend_packages,
$ic_ht_area_id, $ic_ht_area_id,
$ic_ht_area_type, $ic_ht_area_type,
$ic_ht_product_id, $ic_ht_product_id,
$ic_ht_product_type, $ic_ht_product_type,
$ic_author $ic_author,
) { ]
$ic_content = str_replace('http:' . $this->config->item('site_image_url'), $this->config->item('site_image_url'), $ic_content); );
$ic_content = str_replace($this->config->item('media_image_url_remote2'), $this->config->item('site_image_url'), $ic_content); $this->insert_id = $this->HT->last_id('infoContents');
$ic_content = str_replace($this->config->item('media_image_url_org'), $this->config->item('site_image_url'), $ic_content); return $query;
$ic_content = str_replace($this->config->item('media_image_url'), $this->config->item('site_image_url'), $ic_content); }
$ic_content = str_replace($this->config->item('media_image_url2'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url_remote'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url3'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url_org2'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace('#textarea#', 'textarea', $ic_content);
$ic_content = str_replace('t_e_x_t_a_r_e_a', 'textarea', $ic_content);
$sql = "INSERT INTO infoContents \n"
. " ( \n"
. " ic_url, ic_url_title, ic_type, ic_title, ic_content, ic_summary, ic_seo_title, \n"
. " ic_seo_description, ic_seo_keywords, ic_show_bread_crumbs, ic_status, \n"
. " ic_template, ic_photo,ic_photo_width,ic_photo_height, ic_sitecode, ic_recommend_tours, ic_recommend_packages, \n"
. " ic_ht_area_id, ic_ht_area_type,ic_ht_product_id,ic_ht_product_type,ic_author, ic_datetime \n"
. " ) \n"
. "VALUES \n"
. " ( N?,N?,?,N?,N?,N?,N?,N?,N?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,getdate() )";
$query = $this->HT->query(
$sql,
array(
$ic_url,
$ic_url_title,
$ic_type,
$ic_title,
str_replace(
$this->config->item('media_image_url'),
$this->config->item('site_image_url'),
$ic_content
),
$ic_summary,
$ic_seo_title,
$ic_seo_description,
$ic_seo_keywords,
$ic_show_bread_crumbs,
$ic_status,
$ic_template,
$ic_photo,
$ic_photo_width,
$ic_photo_height,
$this->config->item('site_code'),
$ic_recommend_tours,
$ic_recommend_packages,
$ic_ht_area_id,
$ic_ht_area_type,
$ic_ht_product_id,
$ic_ht_product_type,
$ic_author
)
);
$this->insert_id = $this->HT->last_id('infoContents');
return $query;
}
function Add_with_sitecode( function Add_with_sitecode(
$ic_url,
$ic_url_title,
$ic_type,
$ic_title,
$ic_content,
$ic_summary,
$ic_seo_title,
$ic_seo_description,
$ic_seo_keywords,
$ic_show_bread_crumbs,
$ic_status,
$ic_template,
$ic_photo,
$ic_photo_width,
$ic_photo_height,
$ic_recommend_tours,
$ic_recommend_packages,
$ic_ht_area_id,
$ic_ht_area_type,
$ic_ht_product_id,
$ic_ht_product_type,
$ic_author,
$site_code = ''
) {
if (empty($site_code)) {
$site_code = $this->config->item('site_code');
}
$ic_content = str_replace('http:' . $this->config->item('site_image_url'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url_remote2'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url_org'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url2'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url_remote'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url3'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url_org2'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace('#textarea#', 'textarea', $ic_content);
$ic_content = str_replace('t_e_x_t_a_r_e_a', 'textarea', $ic_content);
$sql = "INSERT INTO infoContents \n"
. " ( \n"
. " ic_url, ic_url_title, ic_type, ic_title, ic_content, ic_summary, ic_seo_title, \n"
. " ic_seo_description, ic_seo_keywords, ic_show_bread_crumbs, ic_status, \n"
. " ic_template, ic_photo,ic_photo_width,ic_photo_height, ic_sitecode, ic_recommend_tours, ic_recommend_packages, \n"
. " ic_ht_area_id, ic_ht_area_type,ic_ht_product_id,ic_ht_product_type,ic_author, ic_datetime \n"
. " ) \n"
. "VALUES \n"
. " ( N?,N?,?,N?,N?,N?,N?,N?,N?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,getdate() )";
$query = $this->HT->query(
$sql,
[
$ic_url, $ic_url,
$ic_url_title, $ic_url_title,
$ic_type, $ic_type,
$ic_title, $ic_title,
$ic_content, str_replace(
$this->config->item('media_image_url'),
$this->config->item('site_image_url'),
$ic_content
),
$ic_summary, $ic_summary,
$ic_seo_title, $ic_seo_title,
$ic_seo_description, $ic_seo_description,
@ -120,6 +169,7 @@ class InfoContents_model extends CI_Model
$ic_photo, $ic_photo,
$ic_photo_width, $ic_photo_width,
$ic_photo_height, $ic_photo_height,
$site_code,
$ic_recommend_tours, $ic_recommend_tours,
$ic_recommend_packages, $ic_recommend_packages,
$ic_ht_area_id, $ic_ht_area_id,
@ -127,68 +177,80 @@ class InfoContents_model extends CI_Model
$ic_ht_product_id, $ic_ht_product_id,
$ic_ht_product_type, $ic_ht_product_type,
$ic_author, $ic_author,
$site_code = '' ]
) { );
if (empty($site_code)) { $this->insert_id = $this->HT->last_id('infoContents');
$site_code = $this->config->item('site_code'); return $query;
} }
$ic_content = str_replace('http:' . $this->config->item('site_image_url'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url_remote2'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url_org'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url2'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url_remote'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url3'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url_org2'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace('#textarea#', 'textarea', $ic_content);
$ic_content = str_replace('t_e_x_t_a_r_e_a', 'textarea', $ic_content);
$sql = "INSERT INTO infoContents \n"
. " ( \n"
. " ic_url, ic_url_title, ic_type, ic_title, ic_content, ic_summary, ic_seo_title, \n"
. " ic_seo_description, ic_seo_keywords, ic_show_bread_crumbs, ic_status, \n"
. " ic_template, ic_photo,ic_photo_width,ic_photo_height, ic_sitecode, ic_recommend_tours, ic_recommend_packages, \n"
. " ic_ht_area_id, ic_ht_area_type,ic_ht_product_id,ic_ht_product_type,ic_author, ic_datetime \n"
. " ) \n"
. "VALUES \n"
. " ( N?,N?,?,N?,N?,N?,N?,N?,N?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,getdate() )";
$query = $this->HT->query(
$sql,
array(
$ic_url,
$ic_url_title,
$ic_type,
$ic_title,
str_replace(
$this->config->item('media_image_url'),
$this->config->item('site_image_url'),
$ic_content
),
$ic_summary,
$ic_seo_title,
$ic_seo_description,
$ic_seo_keywords,
$ic_show_bread_crumbs,
$ic_status,
$ic_template,
$ic_photo,
$ic_photo_width,
$ic_photo_height,
$site_code,
$ic_recommend_tours,
$ic_recommend_packages,
$ic_ht_area_id,
$ic_ht_area_type,
$ic_ht_product_id,
$ic_ht_product_type,
$ic_author
)
);
$this->insert_id = $this->HT->last_id('infoContents');
return $query;
}
function Update( function Update(
$ic_id, $ic_id,
$ic_url,
$ic_url_title,
$ic_type,
$ic_title,
$ic_content,
$ic_summary,
$ic_seo_title,
$ic_seo_description,
$ic_seo_keywords,
$ic_show_bread_crumbs,
$ic_status,
$ic_template,
$ic_photo,
$ic_photo_width,
$ic_photo_height,
$ic_recommend_tours,
$ic_recommend_packages,
$ic_ht_area_id,
$ic_ht_area_type,
$ic_ht_product_id,
$ic_ht_product_type,
$ic_author
) {
$ic_content = str_replace('http:' . $this->config->item('site_image_url'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url2'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url_org'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url_remote'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url_remote2'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url3'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url_org2'), $this->config->item('site_image_url'), $ic_content);
//todo:临时替换等发布一段时间后取消AH把japan板块搬迁到了JH网站用的
if ($this->config->item('site_code') == 'jh') {$ic_content = str_replace('https://images.asiahighlights.com', 'https://images.japanhighlights.com', $ic_content);}
if ($this->config->item('site_code') == 'jh') {$ic_content = str_replace('https://data.asiahighlights.com', 'https://data.japanhighlights.com', $ic_content);}
$ic_content = str_replace('#textarea#', 'textarea', $ic_content);
$ic_content = str_replace('t_e_x_t_a_r_e_a', 'textarea', $ic_content);
$sql = "UPDATE infoContents \n"
. "SET ic_url = N?, \n"
. " ic_url_title = N?, \n"
. " ic_type = ?, \n"
. " ic_title = N?, \n"
. " ic_content = N?, \n"
. " ic_summary = N?, \n"
. " ic_seo_title = N?, \n"
. " ic_seo_description = N?, \n"
. " ic_seo_keywords = N?, \n"
. " ic_show_bread_crumbs = ?, \n"
. " ic_status = ?, \n"
. " ic_template = ?, \n"
. " ic_photo = ?, \n"
. " ic_photo_width = ?, \n"
. " ic_photo_height = ?, \n"
. " ic_recommend_tours = ?, \n"
. " ic_recommend_packages = ?, \n"
. " ic_datetime = GETDATE() , \n"
. " ic_ht_area_id = ?, \n"
. " ic_ht_area_type = ?, \n"
. " ic_ht_product_id = ?, \n"
. " ic_ht_product_type = ?, \n"
. " ic_author = ? \n"
. "WHERE ic_id = ? \n"
. "AND ic_sitecode = ? ";
$query = $this->HT->query(
$sql,
[
$ic_url, $ic_url,
$ic_url_title, $ic_url_title,
$ic_type, $ic_type,
@ -210,172 +272,104 @@ class InfoContents_model extends CI_Model
$ic_ht_area_type, $ic_ht_area_type,
$ic_ht_product_id, $ic_ht_product_id,
$ic_ht_product_type, $ic_ht_product_type,
$ic_author $ic_author,
) { $ic_id,
$ic_content = str_replace('http:' . $this->config->item('site_image_url'), $this->config->item('site_image_url'), $ic_content); $this->config->item('site_code'),
$ic_content = str_replace($this->config->item('media_image_url'), $this->config->item('site_image_url'), $ic_content); ]
$ic_content = str_replace($this->config->item('media_image_url2'), $this->config->item('site_image_url'), $ic_content); );
$ic_content = str_replace($this->config->item('media_image_url_org'), $this->config->item('site_image_url'), $ic_content); return $query;
$ic_content = str_replace($this->config->item('media_image_url_remote'), $this->config->item('site_image_url'), $ic_content); }
$ic_content = str_replace($this->config->item('media_image_url_remote2'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url3'), $this->config->item('site_image_url'), $ic_content);
$ic_content = str_replace($this->config->item('media_image_url_org2'), $this->config->item('site_image_url'), $ic_content);
//todo:临时替换等发布一段时间后取消AH把japan板块搬迁到了JH网站用的
if ($this->config->item('site_code')=='jh'){ $ic_content = str_replace('https://images.asiahighlights.com', 'https://images.japanhighlights.com', $ic_content);}
if ($this->config->item('site_code')=='jh'){ $ic_content = str_replace('https://data.asiahighlights.com', 'https://data.japanhighlights.com', $ic_content);}
$ic_content = str_replace('#textarea#', 'textarea', $ic_content);
$ic_content = str_replace('t_e_x_t_a_r_e_a', 'textarea', $ic_content);
$sql = "UPDATE infoContents \n" //强制更新信息
. "SET ic_url = N?, \n" function force_update($ic_id, $ic_content) {
. " ic_url_title = N?, \n" $sql = "UPDATE infoContents SET ic_content = N? WHERE ic_id = ?";
. " ic_type = ?, \n" $query = $this->HT->query($sql, [$ic_content, $ic_id]);
. " ic_title = N?, \n" return $query;
. " ic_content = N?, \n" }
. " ic_summary = N?, \n"
. " ic_seo_title = N?, \n"
. " ic_seo_description = N?, \n"
. " ic_seo_keywords = N?, \n"
. " ic_show_bread_crumbs = ?, \n"
. " ic_status = ?, \n"
. " ic_template = ?, \n"
. " ic_photo = ?, \n"
. " ic_photo_width = ?, \n"
. " ic_photo_height = ?, \n"
. " ic_recommend_tours = ?, \n"
. " ic_recommend_packages = ?, \n"
. " ic_datetime = GETDATE() , \n"
. " ic_ht_area_id = ?, \n"
. " ic_ht_area_type = ?, \n"
. " ic_ht_product_id = ?, \n"
. " ic_ht_product_type = ?, \n"
. " ic_author = ? \n"
. "WHERE ic_id = ? \n"
. "AND ic_sitecode = ? ";
$query = $this->HT->query(
$sql,
array(
$ic_url,
$ic_url_title,
$ic_type,
$ic_title,
$ic_content,
$ic_summary,
$ic_seo_title,
$ic_seo_description,
$ic_seo_keywords,
$ic_show_bread_crumbs,
$ic_status,
$ic_template,
$ic_photo,
$ic_photo_width,
$ic_photo_height,
$ic_recommend_tours,
$ic_recommend_packages,
$ic_ht_area_id,
$ic_ht_area_type,
$ic_ht_product_id,
$ic_ht_product_type,
$ic_author,
$ic_id,
$this->config->item('site_code')
)
);
return $query;
}
//强制更新信息 //强制更新信息
function force_update($ic_id, $ic_content) function force_update_url($ic_id, $ic_url) {
{ $sql = "UPDATE infoContents SET ic_url = N? WHERE ic_id = ?";
$sql = "UPDATE infoContents SET ic_content = N? WHERE ic_id = ?"; $query = $this->HT->query($sql, [$ic_url, $ic_id]);
$query = $this->HT->query($sql, array($ic_content, $ic_id)); return $query;
return $query; }
}
//强制更新信息 //强制更新信息
function force_update_url($ic_id, $ic_url) function force_update_ic_photo($ic_id, $ic_photo) {
{ $sql = "UPDATE infoContents SET ic_photo = N? WHERE ic_id = ?";
$sql = "UPDATE infoContents SET ic_url = N? WHERE ic_id = ?"; $query = $this->HT->query($sql, [$ic_photo, $ic_id]);
$query = $this->HT->query($sql, array($ic_url, $ic_id)); return $query;
return $query; }
}
//删除信息 //删除信息
function Delete($ic_id) function Delete($ic_id) {
{ $sql = "DELETE \n"
$sql = "DELETE \n" . "FROM infoContents \n"
. "FROM infoContents \n" . "WHERE ic_id = ?";
. "WHERE ic_id = ?"; $query = $this->HT->query($sql, [$ic_id]);
$query = $this->HT->query($sql, array($ic_id)); return $query;
return $query; }
}
//递增浏览量 //递增浏览量
function inc_views($sitecode, $page_url) function inc_views($sitecode, $page_url) {
{ //查询信息需要过滤url上的域名
//查询信息需要过滤url上的域名 if ($page_url && $sitecode) {
if ($page_url && $sitecode) { $page_url = substr($page_url, strpos($page_url, '/', 8)); //过滤掉url前面的http://
$page_url = substr($page_url, strpos($page_url, '/', 8)); //过滤掉url前面的http:// $sql = "UPDATE infoContents \n"
$sql = "UPDATE infoContents \n" . "SET ic_view = ISNULL(ic_view,0) + 1 \n"
. "SET ic_view = ISNULL(ic_view,0) + 1 \n" . "WHERE ic_sitecode = ? AND ic_url = N?";
. "WHERE ic_sitecode = ? AND ic_url = N?"; return $this->HT->query($sql, [$sitecode, $page_url]);
return $this->HT->query($sql, array($sitecode, $page_url));
}
} }
}
public function get_ic_contents($ic_id) public function get_ic_contents($ic_id) {
{ $sql = "SELECT top 1 ic_id from infoContents where ic_id=?";
$sql = "SELECT top 1 ic_id from infoContents where ic_id=?"; $query = $this->HT->query($sql, [$ic_id]);
$query = $this->HT->query($sql, array($ic_id)); if ($query->result()) {
if ($query->result()) { $row = $query->row();
$row = $query->row(); return $row;
return $row; } else {
} else { return FALSE;
return FALSE;
}
} }
}
public function get_ic_contents2($ic_id) public function get_ic_contents2($ic_id) {
{ $sql = "SELECT top 1 * from infoContents where ic_id=?";
$sql = "SELECT top 1 * from infoContents where ic_id=?"; $query = $this->HT->query($sql, [$ic_id]);
$query = $this->HT->query($sql, array($ic_id)); if ($query->result()) {
if ($query->result()) { $row = $query->row();
$row = $query->row(); return $row;
return $row; } else {
} else { return FALSE;
return FALSE;
}
} }
}
public function get_ic_contents2_gm($ic_id) public function get_ic_contents2_gm($ic_id) {
{ $sql = "SELECT top 1 * from information_gm.dbo.infoContents where ic_id=?";
$sql = "SELECT top 1 * from information_gm.dbo.infoContents where ic_id=?"; $query = $this->HT->query($sql, [$ic_id]);
$query = $this->HT->query($sql, array($ic_id)); if ($query->result()) {
if ($query->result()) { $row = $query->row();
$row = $query->row(); return $row;
return $row; } else {
} else { return FALSE;
return FALSE;
}
} }
}
public function get_ic_contents_by_list($ic_id_list) public function get_ic_contents_by_list($ic_id_list) {
{ $ic_id_list = trim($ic_id_list);
$ic_id_list = trim($ic_id_list); $ic_id_list .= 0;
$ic_id_list .= 0; $sql = "SELECT * from infoContents where ic_id in ($ic_id_list) order by charindex(','+ltrim(ic_id)+',', ',$ic_id_list,')";
$sql = "SELECT * from infoContents where ic_id in ($ic_id_list) order by charindex(','+ltrim(ic_id)+',', ',$ic_id_list,')"; $query = $this->HT->query($sql);
$query = $this->HT->query($sql); if ($query->result()) {
if ($query->result()) { $row = $query->result();
$row = $query->result(); return $row;
return $row; } else {
} else { return FALSE;
return FALSE;
}
} }
}
public function list_use_hb($site) public function list_use_hb($site) {
{ $sql = "
$sql = "
SELECT c.ic_id, c.ic_url SELECT c.ic_id, c.ic_url
FROM infoContents c FROM infoContents c
INNER JOIN infoMetas m INNER JOIN infoMetas m
@ -384,17 +378,16 @@ class InfoContents_model extends CI_Model
AND CONVERT(nvarchar(max), m.im_value) = 'yes' AND CONVERT(nvarchar(max), m.im_value) = 'yes'
AND c.ic_sitecode = ? AND c.ic_sitecode = ?
"; ";
$query = $this->HT->query($sql, array($site)); $query = $this->HT->query($sql, [$site]);
return $query->result(); return $query->result();
} }
public function get_isid_by_icid($ic_id) public function get_isid_by_icid($ic_id) {
{ $sql = "
$sql = "
select is_id from infoStructures s select is_id from infoStructures s
where s.is_ic_id=? where s.is_ic_id=?
"; ";
$query = $this->HT->query($sql, array($ic_id)); $query = $this->HT->query($sql, [$ic_id]);
return $query->row(); return $query->row();
} }
} }

@ -759,8 +759,8 @@ class Information_model extends CI_Model {
$keysql .= ' OR ic_content like \'%' . $key . '%\''; $keysql .= ' OR ic_content like \'%' . $key . '%\'';
$keysql .= ' OR ic_url like \'%' . $key . '%\''; $keysql .= ' OR ic_url like \'%' . $key . '%\'';
$keysql .= ' OR ic_photo like \'%' . $key . '%\''; $keysql .= ' OR ic_photo like \'%' . $key . '%\'';
$keysql .= ' OR m1.im_value like \'%' . $key . '%\''; // $keysql .= ' OR m1.im_value like \'%' . $key . '%\'';
$keysql .= ' OR m2.im_value like \'%' . $key . '%\''; // $keysql .= ' OR m2.im_value like \'%' . $key . '%\'';
} }
$search = ' AND (1=0 ' . $keysql . ')'; $search = ' AND (1=0 ' . $keysql . ')';
$sql = " $sql = "

Loading…
Cancel
Save