|
|
@ -329,8 +329,9 @@ class Information_model extends CI_Model {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//获取3年未更新的信息
|
|
|
|
//获取3年未更新的信息
|
|
|
|
function get_oldest_info($yeardiff = 3, $has_no_pub = true) {
|
|
|
|
function get_oldest_info($yeardiff = 3, $has_no_pub = true, $empty_info = true) {
|
|
|
|
$has_no_pub ? $sql_no_pub = '' : $sql_no_pub = "AND ic_status = 1";
|
|
|
|
$has_no_pub ? $sql_no_pub = '' : $sql_no_pub = "AND ic_status = 1";
|
|
|
|
|
|
|
|
$empty_info ? $sql_empty_info = '' : $sql_empty_info = "AND datalength(ic_content) > 0";
|
|
|
|
//sql
|
|
|
|
//sql
|
|
|
|
$sql = "SELECT
|
|
|
|
$sql = "SELECT
|
|
|
|
ic_id,
|
|
|
|
ic_id,
|
|
|
@ -349,6 +350,7 @@ class Information_model extends CI_Model {
|
|
|
|
WHERE YEAR(GETDATE()) - YEAR(ic_datetime) >= ?
|
|
|
|
WHERE YEAR(GETDATE()) - YEAR(ic_datetime) >= ?
|
|
|
|
AND ic_sitecode = ?
|
|
|
|
AND ic_sitecode = ?
|
|
|
|
".$sql_no_pub."
|
|
|
|
".$sql_no_pub."
|
|
|
|
|
|
|
|
".$sql_empty_info."
|
|
|
|
AND ic_url <> ''
|
|
|
|
AND ic_url <> ''
|
|
|
|
ORDER BY ic_datetime";
|
|
|
|
ORDER BY ic_datetime";
|
|
|
|
$query = $this->HT->query($sql, array($yeardiff, $this->config->item('site_code')));
|
|
|
|
$query = $this->HT->query($sql, array($yeardiff, $this->config->item('site_code')));
|
|
|
|