...
|
...
|
@@ -267,5 +267,53 @@ class Service_News extends Lib_Service |
|
|
return self::service(self::ROUTER)->tag(self::$_tag)->fetchRow('getSameNewsById', array('news_id' => $news_id), array('where'=> $exceptWhere));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取信息
|
|
|
*
|
|
|
* @param string $tag
|
|
|
* @param int $offset
|
|
|
* @param int $limit
|
|
|
* @param array $exceptTags
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function getLatestNews($tag, $offset, $limit, $exceptTags = array())
|
|
|
{
|
|
|
$exceptWhere = "1";
|
|
|
if(is_array($exceptTags) && !empty($exceptTags))
|
|
|
{
|
|
|
$exceptTags = implode("','", $exceptTags);
|
|
|
$exceptWhere = " `tag` NOT IN ('$exceptTags') ";
|
|
|
}
|
|
|
if ($tag)
|
|
|
{
|
|
|
$tag = strip_tags($tag);
|
|
|
$tag = addslashes($tag);
|
|
|
$where = '`tag` like ("'.$tag.'%")' ;
|
|
|
}
|
|
|
$where = ' WHERE '.$where .' AND '.$exceptWhere;
|
|
|
return self::service(self::ROUTER)->tag(self::$_tag)->fetchAssoc('getLatestNews', array('offset' => $offset, 'limit' => $limit), array('where' => $where));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据日期点击率获取列表
|
|
|
*
|
|
|
* @param string $tag
|
|
|
* @param int $offset
|
|
|
* @param int $limit
|
|
|
* @param array $exceptTags
|
|
|
* @return array
|
|
|
*/
|
|
|
public function getListByDateHits($tag, $offset, $limit, $exceptTags)
|
|
|
{
|
|
|
$exceptWhere = "1";
|
|
|
if(is_array($exceptTags) && !empty($exceptTags))
|
|
|
{
|
|
|
$exceptTags = implode("','", $exceptTags);
|
|
|
$exceptWhere = " `tag` NOT IN ('$exceptTags') ";
|
|
|
}
|
|
|
return self::service(self::ROUTER)->tag(self::$_tag)->fetchAssoc('getListByDateHits',array('tag'=> $tag,
|
|
|
'offset'=> intval($offset), 'limit'=> intval($limit)), array('where'=> $exceptWhere));
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|