Authored by whb

修改bug

@@ -607,10 +607,10 @@ seajs._config = { @@ -607,10 +607,10 @@ seajs._config = {
607 */ 607 */
608 var YohoConfig = { 608 var YohoConfig = {
609 baseUrl: '/', 609 baseUrl: '/',
610 - domain: "yohood.test.yoho.cn", 610 + domain: "yohood.yohobuy.com",
611 resdomain: "res.yoho.cn", 611 resdomain: "res.yoho.cn",
612 - mainUrl: 'http://yohood.test.yoho.cn',  
613 - resUrl: "http://res.yohood.test.yoho.cn/", 612 + mainUrl: 'http://yohood.yohobuy.com',
  613 + resUrl: "http://res.test.yohood.yoho.cn/",
614 uploadUrl: "http://" + window.location.host + "/upload/upfile" 614 uploadUrl: "http://" + window.location.host + "/upload/upfile"
615 }; 615 };
616 seajs.config({ 616 seajs.config({
@@ -120,7 +120,7 @@ define('yohood', function(require, exports) { @@ -120,7 +120,7 @@ define('yohood', function(require, exports) {
120 market_price = ''; 120 market_price = '';
121 //价格样式 121 //价格样式
122 price = parts[0] + '.' + (parts[1] ? parts[1] : '00'); 122 price = parts[0] + '.' + (parts[1] ? parts[1] : '00');
123 - if (parseInt(v.market_price) > 0) //原价 123 + if (parseInt(v.market_price) > 0 && v.market_price != v.price) //原价
124 { 124 {
125 parts = v.market_price.split('.'); 125 parts = v.market_price.split('.');
126 market_price = parts[0] + '.' + (parts[1] ? parts[1] : '00'); 126 market_price = parts[0] + '.' + (parts[1] ? parts[1] : '00');
@@ -109,9 +109,9 @@ class Config_Defines @@ -109,9 +109,9 @@ class Config_Defines
109 // 主域名 109 // 主域名
110 define('SITE_DOMAIN', '.test.yoho.cn'); 110 define('SITE_DOMAIN', '.test.yoho.cn');
111 // 静态资源目录 111 // 静态资源目录
112 - define('SITE_RES', 'http://res.yohood.test.yoho.cn'); 112 + define('SITE_RES', 'http://res.test.yohood.yoho.cn');
113 // 主站 113 // 主站
114 - define('SITE_MAIN', 'http://yohood.test.yoho.cn'); 114 + define('SITE_MAIN', 'http://yohobuy.yohobuy.com');
115 define('QINIU_UPLOAD_STATE', true); 115 define('QINIU_UPLOAD_STATE', true);
116 define('QINIU_UPLOAD_CLASS', 'Lib_Utils_QiniuUpload'); 116 define('QINIU_UPLOAD_CLASS', 'Lib_Utils_QiniuUpload');
117 define('QINIU_UPLOAD_ACCESSKEY', 'cY9B5ZgON_7McTS5zV5nTeRyQ98MOcVD7W4eGVbE'); 117 define('QINIU_UPLOAD_ACCESSKEY', 'cY9B5ZgON_7McTS5zV5nTeRyQ98MOcVD7W4eGVbE');
@@ -156,8 +156,8 @@ class Controller_News extends Controller_Abstract @@ -156,8 +156,8 @@ class Controller_News extends Controller_Abstract
156 unset($temp[$id]); 156 unset($temp[$id]);
157 $recom = array_merge($recom, $temp); 157 $recom = array_merge($recom, $temp);
158 $recom = array_slice(array_filter($recom), 0, 3); 158 $recom = array_slice(array_filter($recom), 0, 3);
159 - $hotVideo = array_values(Facade_News::getListByHits($tag, 0, 5, $exceptTags));  
160 - $lastVideo = array_values(Facade_News::getList($tag, 0, 5, $exceptTags)); 159 + $hotVideo = array_values(Facade_News::getListByDateHits($tag, 0, 5, $exceptTags));
  160 + $lastVideo = array_values(Facade_News::getLatestNews($tag, 0, 5, $exceptTags));
161 $list['recom'] = $recom; 161 $list['recom'] = $recom;
162 $list['hotVideo'] = $hotVideo; 162 $list['hotVideo'] = $hotVideo;
163 $list['lastVideo'] = $lastVideo; 163 $list['lastVideo'] = $lastVideo;
@@ -18,7 +18,7 @@ class Controller_Admin_News extends Controller_Admin_Base @@ -18,7 +18,7 @@ class Controller_Admin_News extends Controller_Admin_Base
18 $list = Facade_News::getList($conditions, $pagination->getOffset(),$limit); 18 $list = Facade_News::getList($conditions, $pagination->getOffset(),$limit);
19 foreach ($list as $k => $v) 19 foreach ($list as $k => $v)
20 { 20 {
21 - $list[$k]['content'] = Util_StringHelper::substr_cn(strip_tags($v['content']),30); 21 + $list[$k]['content'] = str_replace(array("\n","\r","\t"),'', Util_StringHelper::substr_cn(strip_tags($v['content']),30));
22 if ($v['thumb']) 22 if ($v['thumb'])
23 { 23 {
24 $list[$k]['thumb'] = Lib_Images::getImageUrl($v['thumb'],'0140x0060','fragmentimg'); 24 $list[$k]['thumb'] = Lib_Images::getImageUrl($v['thumb'],'0140x0060','fragmentimg');
@@ -247,6 +247,20 @@ class Facade_News @@ -247,6 +247,20 @@ class Facade_News
247 } 247 }
248 248
249 /** 249 /**
  250 + * 获取信息
  251 + *
  252 + * @param string $tag
  253 + * @param int $offset
  254 + * @param int $limit
  255 + * @param array $exceptTags
  256 + * @return array
  257 + */
  258 + public static function getLatestNews($tag, $offset, $limit, $exceptTags = array())
  259 + {
  260 + return self::service()->getLatestNews($tag, $offset, $limit, $exceptTags);
  261 + }
  262 +
  263 + /**
250 * 根据id获取相同的新闻 264 * 根据id获取相同的新闻
251 * 265 *
252 * @param int $id 266 * @param int $id
@@ -257,4 +271,18 @@ class Facade_News @@ -257,4 +271,18 @@ class Facade_News
257 { 271 {
258 return self::service()->getSameNewsById($id, $exceptTags); 272 return self::service()->getSameNewsById($id, $exceptTags);
259 } 273 }
  274 +
  275 + /**
  276 + * 根据日期点击率获取列表
  277 + *
  278 + * @param string $tag
  279 + * @param int $offset
  280 + * @param int $limit
  281 + * @param array $exceptTags
  282 + * @return array
  283 + */
  284 + public static function getListByDateHits($tag, $offset, $limit, $exceptTags)
  285 + {
  286 + return self::service()->getListByDateHits($tag, $offset, $limit, $exceptTags);
  287 + }
260 } 288 }
@@ -267,5 +267,53 @@ class Service_News extends Lib_Service @@ -267,5 +267,53 @@ class Service_News extends Lib_Service
267 return self::service(self::ROUTER)->tag(self::$_tag)->fetchRow('getSameNewsById', array('news_id' => $news_id), array('where'=> $exceptWhere)); 267 return self::service(self::ROUTER)->tag(self::$_tag)->fetchRow('getSameNewsById', array('news_id' => $news_id), array('where'=> $exceptWhere));
268 } 268 }
269 269
  270 + /**
  271 + * 获取信息
  272 + *
  273 + * @param string $tag
  274 + * @param int $offset
  275 + * @param int $limit
  276 + * @param array $exceptTags
  277 + * @return array
  278 + */
  279 + public static function getLatestNews($tag, $offset, $limit, $exceptTags = array())
  280 + {
  281 + $exceptWhere = "1";
  282 + if(is_array($exceptTags) && !empty($exceptTags))
  283 + {
  284 + $exceptTags = implode("','", $exceptTags);
  285 + $exceptWhere = " `tag` NOT IN ('$exceptTags') ";
  286 + }
  287 + if ($tag)
  288 + {
  289 + $tag = strip_tags($tag);
  290 + $tag = addslashes($tag);
  291 + $where = '`tag` like ("'.$tag.'%")' ;
  292 + }
  293 + $where = ' WHERE '.$where .' AND '.$exceptWhere;
  294 + return self::service(self::ROUTER)->tag(self::$_tag)->fetchAssoc('getLatestNews', array('offset' => $offset, 'limit' => $limit), array('where' => $where));
  295 + }
  296 +
  297 + /**
  298 + * 根据日期点击率获取列表
  299 + *
  300 + * @param string $tag
  301 + * @param int $offset
  302 + * @param int $limit
  303 + * @param array $exceptTags
  304 + * @return array
  305 + */
  306 + public function getListByDateHits($tag, $offset, $limit, $exceptTags)
  307 + {
  308 + $exceptWhere = "1";
  309 + if(is_array($exceptTags) && !empty($exceptTags))
  310 + {
  311 + $exceptTags = implode("','", $exceptTags);
  312 + $exceptWhere = " `tag` NOT IN ('$exceptTags') ";
  313 + }
  314 + return self::service(self::ROUTER)->tag(self::$_tag)->fetchAssoc('getListByDateHits',array('tag'=> $tag,
  315 + 'offset'=> intval($offset), 'limit'=> intval($limit)), array('where'=> $exceptWhere));
  316 +
  317 + }
270 } 318 }
271 319
@@ -43,10 +43,16 @@ @@ -43,10 +43,16 @@
43 SELECT COUNT(*) FROM tbl_news WHERE `tag` = :tag AND create_time < :time 43 SELECT COUNT(*) FROM tbl_news WHERE `tag` = :tag AND create_time < :time
44 </select> 44 </select>
45 <select id="getListByHits"> 45 <select id="getListByHits">
46 - SELECT * FROM tbl_news WHERE `tag` = :tag AND #where# ORDER BY create_time DESC LIMIT :offset, :limit 46 + SELECT * FROM tbl_news WHERE `tag` = :tag AND #where# ORDER BY hits DESC LIMIT :offset, :limit
47 </select> 47 </select>
48 <select id="getSameNewsById"> 48 <select id="getSameNewsById">
49 SELECT * FROM tbl_news WHERE id &lt;&gt; :news_id AND #where# AND id IN ( 49 SELECT * FROM tbl_news WHERE id &lt;&gt; :news_id AND #where# AND id IN (
50 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) ) 50 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) )
51 </select> 51 </select>
  52 + <select id="getLatestNews">
  53 + SELECT * FROM `tbl_news` #where# order by create_time DESC LIMIT :offset, :limit
  54 + </select>
  55 + <select id="getListByDateHits">
  56 + 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
  57 + </select>
52 </sqlMap> 58 </sqlMap>
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
19 </li> 19 </li>
20 <li> 20 <li>
21 <span>YOHO!BOYS</span> 21 <span>YOHO!BOYS</span>
22 - <a href="http://www.yohoboys.com">男生潮流</a> 22 + <a href="http://www.yohoboys.com" target="_blank">男生潮流</a>
23 </li> 23 </li>
24 <li> 24 <li>
25 <span>YOHO!GIRLS</span> 25 <span>YOHO!GIRLS</span>
@@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
34 <tr> 34 <tr>
35 <td><?php echo $feedback['id'];?></td> 35 <td><?php echo $feedback['id'];?></td>
36 <td><?php echo $feedback['tag']?></td> 36 <td><?php echo $feedback['tag']?></td>
37 - <td title="<?php echo $feedback['title'];?>"><?php echo $feedback['title'];?></td> 37 + <td title="<?php echo $feedback['title'];?>"><?php echo trim($feedback['title']);?></td>
38 <td title="<?php echo $feedback['content'];?>"><?php echo $feedback['content']?></td> 38 <td title="<?php echo $feedback['content'];?>"><?php echo $feedback['content']?></td>
39 <td> 39 <td>
40 <?php if ($feedback['thumb']):?> 40 <?php if ($feedback['thumb']):?>
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 <a href="<?php echo $this->view->info['link'];?>" target="_blank">进入品牌店铺</a> 11 <a href="<?php echo $this->view->info['link'];?>" target="_blank">进入品牌店铺</a>
12 </div> 12 </div>
13 </div> 13 </div>
14 - <a href="javascipt:;" class="brand-close-btn iconfont">&#xe606;</a> 14 + <a href="javascipt:void(0);" class="brand-close-btn iconfont">&#xe606;</a>
15 <?php if(!empty($this->view->news)):?> 15 <?php if(!empty($this->view->news)):?>
16 <div class="related-post"> 16 <div class="related-post">
17 <h3>相关资讯</h3> 17 <h3>相关资讯</h3>