Authored by whb

修改bug

... ... @@ -607,10 +607,10 @@ seajs._config = {
*/
var YohoConfig = {
baseUrl: '/',
domain: "yohood.test.yoho.cn",
domain: "yohood.yohobuy.com",
resdomain: "res.yoho.cn",
mainUrl: 'http://yohood.test.yoho.cn',
resUrl: "http://res.yohood.test.yoho.cn/",
mainUrl: 'http://yohood.yohobuy.com',
resUrl: "http://res.test.yohood.yoho.cn/",
uploadUrl: "http://" + window.location.host + "/upload/upfile"
};
seajs.config({
... ...
... ... @@ -120,7 +120,7 @@ define('yohood', function(require, exports) {
market_price = '';
//价格样式
price = parts[0] + '.' + (parts[1] ? parts[1] : '00');
if (parseInt(v.market_price) > 0) //原价
if (parseInt(v.market_price) > 0 && v.market_price != v.price) //原价
{
parts = v.market_price.split('.');
market_price = parts[0] + '.' + (parts[1] ? parts[1] : '00');
... ...
... ... @@ -109,9 +109,9 @@ class Config_Defines
// 主域名
define('SITE_DOMAIN', '.test.yoho.cn');
// 静态资源目录
define('SITE_RES', 'http://res.yohood.test.yoho.cn');
define('SITE_RES', 'http://res.test.yohood.yoho.cn');
// 主站
define('SITE_MAIN', 'http://yohood.test.yoho.cn');
define('SITE_MAIN', 'http://yohobuy.yohobuy.com');
define('QINIU_UPLOAD_STATE', true);
define('QINIU_UPLOAD_CLASS', 'Lib_Utils_QiniuUpload');
define('QINIU_UPLOAD_ACCESSKEY', 'cY9B5ZgON_7McTS5zV5nTeRyQ98MOcVD7W4eGVbE');
... ...
... ... @@ -156,8 +156,8 @@ class Controller_News extends Controller_Abstract
unset($temp[$id]);
$recom = array_merge($recom, $temp);
$recom = array_slice(array_filter($recom), 0, 3);
$hotVideo = array_values(Facade_News::getListByHits($tag, 0, 5, $exceptTags));
$lastVideo = array_values(Facade_News::getList($tag, 0, 5, $exceptTags));
$hotVideo = array_values(Facade_News::getListByDateHits($tag, 0, 5, $exceptTags));
$lastVideo = array_values(Facade_News::getLatestNews($tag, 0, 5, $exceptTags));
$list['recom'] = $recom;
$list['hotVideo'] = $hotVideo;
$list['lastVideo'] = $lastVideo;
... ...
... ... @@ -18,7 +18,7 @@ class Controller_Admin_News extends Controller_Admin_Base
$list = Facade_News::getList($conditions, $pagination->getOffset(),$limit);
foreach ($list as $k => $v)
{
$list[$k]['content'] = Util_StringHelper::substr_cn(strip_tags($v['content']),30);
$list[$k]['content'] = str_replace(array("\n","\r","\t"),'', Util_StringHelper::substr_cn(strip_tags($v['content']),30));
if ($v['thumb'])
{
$list[$k]['thumb'] = Lib_Images::getImageUrl($v['thumb'],'0140x0060','fragmentimg');
... ... @@ -95,7 +95,7 @@ class Controller_Admin_News extends Controller_Admin_Base
}
}
$info['pics'] = $pics;
}
}
$this->_view['key'] = Lib_Images::genKey('fragmentimg');
$this->_view['tags'] = Facade_News::getTags();
$this->_view['info'] = $info ;
... ...
... ... @@ -246,6 +246,20 @@ class Facade_News
return self::service()->getListByHits($tag, $offset, $limit, $exceptTags);
}
/**
* 获取信息
*
* @param string $tag
* @param int $offset
* @param int $limit
* @param array $exceptTags
* @return array
*/
public static function getLatestNews($tag, $offset, $limit, $exceptTags = array())
{
return self::service()->getLatestNews($tag, $offset, $limit, $exceptTags);
}
/**
* 根据id获取相同的新闻
*
... ... @@ -257,4 +271,18 @@ class Facade_News
{
return self::service()->getSameNewsById($id, $exceptTags);
}
/**
* 根据日期点击率获取列表
*
* @param string $tag
* @param int $offset
* @param int $limit
* @param array $exceptTags
* @return array
*/
public static function getListByDateHits($tag, $offset, $limit, $exceptTags)
{
return self::service()->getListByDateHits($tag, $offset, $limit, $exceptTags);
}
}
\ No newline at end of file
... ...
... ... @@ -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));
}
}
... ...
... ... @@ -43,10 +43,16 @@
SELECT COUNT(*) FROM tbl_news WHERE `tag` = :tag AND create_time < :time
</select>
<select id="getListByHits">
SELECT * FROM tbl_news WHERE `tag` = :tag AND #where# ORDER BY create_time DESC LIMIT :offset, :limit
SELECT * FROM tbl_news WHERE `tag` = :tag AND #where# ORDER BY hits DESC LIMIT :offset, :limit
</select>
<select id="getSameNewsById">
SELECT * FROM tbl_news WHERE id &lt;&gt; :news_id AND #where# AND id IN (
SELECT news_id FROM tbl_news_brand_rela WHERE brand_id IN (SELECT brand_id FROM tbl_news_brand_rela WHERE news_id = :news_id) )
</select>
<select id="getLatestNews">
SELECT * FROM `tbl_news` #where# order by create_time DESC LIMIT :offset, :limit
</select>
<select id="getListByDateHits">
SELECT * FROM tbl_news WHERE `tag` = :tag AND #where# ORDER BY UNIX_TIMESTAMP(FROM_UNIXTIME(create_time,'%Y-%m-%d')) DESC, hits DESC LIMIT :offset, :limit
</select>
</sqlMap>
\ No newline at end of file
... ...
... ... @@ -19,7 +19,7 @@
</li>
<li>
<span>YOHO!BOYS</span>
<a href="http://www.yohoboys.com">男生潮流</a>
<a href="http://www.yohoboys.com" target="_blank">男生潮流</a>
</li>
<li>
<span>YOHO!GIRLS</span>
... ...
... ... @@ -34,8 +34,8 @@
<tr>
<td><?php echo $feedback['id'];?></td>
<td><?php echo $feedback['tag']?></td>
<td title="<?php echo $feedback['title'];?>"><?php echo $feedback['title'];?></td>
<td title="<?php echo $feedback['content'];?>"><?php echo $feedback['content']?></td>
<td title="<?php echo $feedback['title'];?>"><?php echo trim($feedback['title']);?></td>
<td title="<?php echo $feedback['content'];?>"><?php echo $feedback['content']?></td>
<td>
<?php if ($feedback['thumb']):?>
<img width="80" height="60" src="<?php echo $feedback['thumb']?>"/>
... ...
... ... @@ -11,7 +11,7 @@
<a href="<?php echo $this->view->info['link'];?>" target="_blank">进入品牌店铺</a>
</div>
</div>
<a href="javascipt:;" class="brand-close-btn iconfont">&#xe606;</a>
<a href="javascipt:void(0);" class="brand-close-btn iconfont">&#xe606;</a>
<?php if(!empty($this->view->news)):?>
<div class="related-post">
<h3>相关资讯</h3>
... ...