Merge branch 'release/5.0.1'
Showing
5 changed files
with
30 additions
and
23 deletions
@@ -470,6 +470,14 @@ class HelperSearch | @@ -470,6 +470,14 @@ class HelperSearch | ||
470 | return $result; | 470 | return $result; |
471 | } | 471 | } |
472 | $params = self::$params; | 472 | $params = self::$params; |
473 | + do { | ||
474 | + if (isset($params['ageLevel']) && $params['ageLevel'] == 1) { | ||
475 | + break; | ||
476 | + } | ||
477 | + if (count($filter['ageLevel']) === 1 && $filter['ageLevel'][0]['name'] === '成人') { | ||
478 | + return $result; | ||
479 | + } | ||
480 | + }while(false); | ||
473 | $ageLevel = isset($params['ageLevel']) ? $params['ageLevel'] : ''; | 481 | $ageLevel = isset($params['ageLevel']) ? $params['ageLevel'] : ''; |
474 | if (isset($params['ageLevel'])) { | 482 | if (isset($params['ageLevel'])) { |
475 | unset($params['ageLevel']); | 483 | unset($params['ageLevel']); |
@@ -477,8 +485,7 @@ class HelperSearch | @@ -477,8 +485,7 @@ class HelperSearch | ||
477 | if (self::$total == 0) { | 485 | if (self::$total == 0) { |
478 | return $result; | 486 | return $result; |
479 | } | 487 | } |
480 | - | ||
481 | - sort($filter['ageLevel']); | 488 | + |
482 | foreach ($filter['ageLevel'] as $key => $val) { | 489 | foreach ($filter['ageLevel'] as $key => $val) { |
483 | if (intval($val['id']) === $ageLevel) { | 490 | if (intval($val['id']) === $ageLevel) { |
484 | self::$selected['ageLevel'] = array( | 491 | self::$selected['ageLevel'] = array( |
@@ -359,7 +359,7 @@ class Helpers | @@ -359,7 +359,7 @@ class Helpers | ||
359 | $result['id'] = $articleData['id']; | 359 | $result['id'] = $articleData['id']; |
360 | $result['classification'] = $articleData['category_name']; | 360 | $result['classification'] = $articleData['category_name']; |
361 | $result['isReco'] = $articleData['is_recommended'] ? true : false; | 361 | $result['isReco'] = $articleData['is_recommended'] ? true : false; |
362 | - $result['url'] = $isApp ? $articleData['url'] : self::url('/'.$articleData['id'].'.html', array(), 'guang'); | 362 | + $result['url'] = $articleData['url'] ? $articleData['url'] : self::url('/'.$articleData['id'].'.html', array(), 'guang'); |
363 | $result['img'] = self::getImageUrl($articleData['src'], $width, $height, 1); | 363 | $result['img'] = self::getImageUrl($articleData['src'], $width, $height, 1); |
364 | $result['isSquareImg'] = $isSquareImage; | 364 | $result['isSquareImg'] = $isSquareImage; |
365 | $result['title'] = $articleData['title']; | 365 | $result['title'] = $articleData['title']; |
@@ -48,20 +48,6 @@ | @@ -48,20 +48,6 @@ | ||
48 | </div> | 48 | </div> |
49 | {{/if}} | 49 | {{/if}} |
50 | 50 | ||
51 | - {{#if ageLevel}} | ||
52 | - <div class="channel section"> | ||
53 | - <span class="title">年龄:</span> | ||
54 | - | ||
55 | - <div class="attr-content clearfix"> | ||
56 | - {{#each ageLevel}} | ||
57 | - <a class="attr {{#if checked}}checked{{/if}}" href="{{href}}"> | ||
58 | - {{name}} | ||
59 | - </a> | ||
60 | - {{/each}} | ||
61 | - </div> | ||
62 | - </div> | ||
63 | - {{/if}} | ||
64 | - | ||
65 | {{#if sort}} | 51 | {{#if sort}} |
66 | <div class="sort section"> | 52 | <div class="sort section"> |
67 | <span class="title">分类:</span> | 53 | <span class="title">分类:</span> |
@@ -180,6 +166,20 @@ | @@ -180,6 +166,20 @@ | ||
180 | </div> | 166 | </div> |
181 | {{/ brand}} | 167 | {{/ brand}} |
182 | 168 | ||
169 | + {{#if ageLevel}} | ||
170 | + <div class="channel section"> | ||
171 | + <span class="title">人群:</span> | ||
172 | + | ||
173 | + <div class="attr-content clearfix"> | ||
174 | + {{#each ageLevel}} | ||
175 | + <a class="attr {{#if checked}}checked{{/if}}" href="{{href}}"> | ||
176 | + {{name}} | ||
177 | + </a> | ||
178 | + {{/each}} | ||
179 | + </div> | ||
180 | + </div> | ||
181 | + {{/if}} | ||
182 | + | ||
183 | {{#if price}} | 183 | {{#if price}} |
184 | <div class="price section"> | 184 | <div class="price section"> |
185 | <span class="title">价格:</span> | 185 | <span class="title">价格:</span> |
@@ -75,9 +75,9 @@ class IndexModel | @@ -75,9 +75,9 @@ class IndexModel | ||
75 | $data = ListData::category(); | 75 | $data = ListData::category(); |
76 | foreach($data['data'] as $category) | 76 | foreach($data['data'] as $category) |
77 | { | 77 | { |
78 | - if ($category['name'] == '专题') { | ||
79 | - continue; | ||
80 | - } | 78 | + // if ($category['name'] == '专题') { |
79 | + // continue; | ||
80 | + // } | ||
81 | 81 | ||
82 | $ret[] = array('typeId' => $category['id'],'type' => $category['name'], | 82 | $ret[] = array('typeId' => $category['id'],'type' => $category['name'], |
83 | 'isActive' => $currentSortId == $category['id'] ? true :false, | 83 | 'isActive' => $currentSortId == $category['id'] ? true :false, |
@@ -153,7 +153,7 @@ class IndexModel | @@ -153,7 +153,7 @@ class IndexModel | ||
153 | if(!empty($data['data'])) { | 153 | if(!empty($data['data'])) { |
154 | foreach($data['data'] as $key => $article) { | 154 | foreach($data['data'] as $key => $article) { |
155 | $list[] = array( | 155 | $list[] = array( |
156 | - 'url' => Helpers::url('/'.$article['id'].'.html', '', 'guang'), | 156 | + 'url' => $article['url'] ? $article['url'] : Helpers::url('/'.$article['id'].'.html', '', 'guang'), |
157 | 'title' => $article['title'] | 157 | 'title' => $article['title'] |
158 | ); | 158 | ); |
159 | if (isset($article['src']) && !empty($article['src'])) { | 159 | if (isset($article['src']) && !empty($article['src'])) { |
@@ -134,7 +134,7 @@ class InfoModel | @@ -134,7 +134,7 @@ class InfoModel | ||
134 | foreach ($data['relate'] as $key => $val) { | 134 | foreach ($data['relate'] as $key => $val) { |
135 | $result['relatedPost'][$key]['title'] = $val['title']; | 135 | $result['relatedPost'][$key]['title'] = $val['title']; |
136 | $result['relatedPost'][$key]['thumb'] = Images::getImageUrl($val['thumb'], 264, 173, 1); | 136 | $result['relatedPost'][$key]['thumb'] = Images::getImageUrl($val['thumb'], 264, 173, 1); |
137 | - $result['relatedPost'][$key]['url'] = Helpers::url('/'.$val['id'].'.html', array(), 'guang'); | 137 | + $result['relatedPost'][$key]['url'] = isset($val['url']) && $val['url'] ? $val['url'] : Helpers::url('/'.$val['id'].'.html', array(), 'guang'); |
138 | } | 138 | } |
139 | } | 139 | } |
140 | //精彩推荐 | 140 | //精彩推荐 |
@@ -142,7 +142,7 @@ class InfoModel | @@ -142,7 +142,7 @@ class InfoModel | ||
142 | foreach ($data['recommend'] as $key => $val) { | 142 | foreach ($data['recommend'] as $key => $val) { |
143 | $result['exRecos'][$key]['title'] = $val['title']; | 143 | $result['exRecos'][$key]['title'] = $val['title']; |
144 | $result['exRecos'][$key]['img'] = isset($val['src']) ? Images::getImageUrl($val['src'], 90, 60) : ''; | 144 | $result['exRecos'][$key]['img'] = isset($val['src']) ? Images::getImageUrl($val['src'], 90, 60) : ''; |
145 | - $result['exRecos'][$key]['url'] = Helpers::url('/'.$val['id'].'.html', array(), 'guang'); | 145 | + $result['exRecos'][$key]['url'] = isset($val['url']) && $val['url'] ? $val['url'] : Helpers::url('/'.$val['id'].'.html', array(), 'guang'); |
146 | } | 146 | } |
147 | } | 147 | } |
148 | //热门标签 | 148 | //热门标签 |
-
Please register or login to post a comment