add list_use_hb

master
LMR 10 months ago
parent 5a1f579d0b
commit ee7cbadeba

@ -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

@ -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;
}
}
}

Loading…
Cancel
Save