Merge branch 'release/5.0.0'
Showing
18 changed files
with
63 additions
and
33 deletions
compile/www.yohobuy.com/5.0.0/test.php
0 → 100644
@@ -483,7 +483,10 @@ class SearchData | @@ -483,7 +483,10 @@ class SearchData | ||
483 | */ | 483 | */ |
484 | public static function getBrandListUrl($param = array()) | 484 | public static function getBrandListUrl($param = array()) |
485 | { | 485 | { |
486 | - return Yohobuy::httpBuildQuery(SearchData::getUrl('brand'), $param); | 486 | + $param = Yohobuy::param(); |
487 | + $param['method'] = 'web.search.favorBrand'; | ||
488 | + $param['client_secret'] = Sign::getSign($param); | ||
489 | + return Yohobuy::httpBuildQuery(API_URL, $param); | ||
487 | } | 490 | } |
488 | 491 | ||
489 | /** | 492 | /** |
@@ -609,4 +612,23 @@ class SearchData | @@ -609,4 +612,23 @@ class SearchData | ||
609 | 612 | ||
610 | return Yohobuy::get(API_URL, $param); | 613 | return Yohobuy::get(API_URL, $param); |
611 | } | 614 | } |
615 | + | ||
616 | + public static function webSearchByCondition(array $condition, $isOnlyUrl = false) { | ||
617 | + $result = array(); | ||
618 | + if(!empty($condition)) { | ||
619 | + $param = Yohobuy::param(); | ||
620 | + $param['method'] = 'web.search.search'; | ||
621 | + $param['sales'] = 'Y'; | ||
622 | + $param['outlets'] = 2; | ||
623 | + $param['stocknumber'] = 1; | ||
624 | + $param += $condition; | ||
625 | + $param['client_secret'] = Sign::getSign($param); | ||
626 | + | ||
627 | + if($isOnlyUrl) { | ||
628 | + return Yohobuy::httpBuildQuery(API_URL, $param); | ||
629 | + } | ||
630 | + $result = Yohobuy::get(API_URL, $param); | ||
631 | + } | ||
632 | + return $result; | ||
633 | + } | ||
612 | } | 634 | } |
@@ -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 | //热门标签 |
@@ -229,7 +229,7 @@ class InfoModel | @@ -229,7 +229,7 @@ class InfoModel | ||
229 | $arr[$val['id']]=$val['src']; | 229 | $arr[$val['id']]=$val['src']; |
230 | } | 230 | } |
231 | if (!empty($productSkn)) { | 231 | if (!empty($productSkn)) { |
232 | - $product = SearchData::searchElasticByCondition(array('query'=> implode(',', $productSkn))); | 232 | + $product = SearchData::webSearchByCondition(array('query'=> implode(',', $productSkn), 'viewNum' => 100)); |
233 | if (isset($product['data']['product_list'])) { | 233 | if (isset($product['data']['product_list'])) { |
234 | $result = self::formatProduct($product['data']['product_list'], $arr); | 234 | $result = self::formatProduct($product['data']['product_list'], $arr); |
235 | } | 235 | } |
@@ -65,8 +65,9 @@ class IndexModel | @@ -65,8 +65,9 @@ class IndexModel | ||
65 | $url['fav_brand'] = SearchData::getBrandListUrl(); | 65 | $url['fav_brand'] = SearchData::getBrandListUrl(); |
66 | //新品上架 | 66 | //新品上架 |
67 | $productParam['new'] = 'Y'; | 67 | $productParam['new'] = 'Y'; |
68 | + $productParam['order'] = 's_t_desc'; | ||
68 | $productParam['viewNum'] = 10; | 69 | $productParam['viewNum'] = 10; |
69 | - $url['new'] = SearchData::getProductUrl($productParam); | 70 | + $url['new'] = SearchData::webSearchByCondition($productParam, true); |
70 | //调用接口数据 | 71 | //调用接口数据 |
71 | $data = Yohobuy::getMulti($url); | 72 | $data = Yohobuy::getMulti($url); |
72 | //格式化数据 | 73 | //格式化数据 |
@@ -398,7 +398,7 @@ class SearchModel | @@ -398,7 +398,7 @@ class SearchModel | ||
398 | $param['query'] = implode(',', $skn); | 398 | $param['query'] = implode(',', $skn); |
399 | $skn = array_flip($skn); | 399 | $skn = array_flip($skn); |
400 | $param['viewNum'] = $limit; | 400 | $param['viewNum'] = $limit; |
401 | - $data = SearchData::searchElasticByCondition($param); | 401 | + $data = SearchData::webSearchByCondition($param); |
402 | if (!isset($data['code']) || $data['code'] != 200 || !isset($data['data']['product_list']) || empty($data['data']['product_list'])) { | 402 | if (!isset($data['code']) || $data['code'] != 200 || !isset($data['data']['product_list']) || empty($data['data']['product_list'])) { |
403 | return $result; | 403 | return $result; |
404 | } | 404 | } |
@@ -50,7 +50,7 @@ application.template.ext = ".phtml" | @@ -50,7 +50,7 @@ application.template.ext = ".phtml" | ||
50 | application.assets.path = ROOT_PATH "/assets/web" | 50 | application.assets.path = ROOT_PATH "/assets/web" |
51 | 51 | ||
52 | ; 应用的版本号 | 52 | ; 应用的版本号 |
53 | -application.version = "4.9.19" | 53 | +application.version = "5.0.0" |
54 | 54 | ||
55 | ; 网站SEO信息 | 55 | ; 网站SEO信息 |
56 | application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证" | 56 | application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证" |
@@ -50,7 +50,7 @@ application.template.ext = ".phtml" | @@ -50,7 +50,7 @@ application.template.ext = ".phtml" | ||
50 | application.assets.path = ROOT_PATH "/assets/web" | 50 | application.assets.path = ROOT_PATH "/assets/web" |
51 | 51 | ||
52 | ; 应用的版本号 | 52 | ; 应用的版本号 |
53 | -application.version = "4.9.19" | 53 | +application.version = "5.0.0" |
54 | 54 | ||
55 | ; 网站SEO信息 | 55 | ; 网站SEO信息 |
56 | application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证" | 56 | application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证" |
@@ -50,7 +50,7 @@ application.template.ext = ".phtml" | @@ -50,7 +50,7 @@ application.template.ext = ".phtml" | ||
50 | application.assets.path = ROOT_PATH "/assets/web" | 50 | application.assets.path = ROOT_PATH "/assets/web" |
51 | 51 | ||
52 | ; 应用的版本号 | 52 | ; 应用的版本号 |
53 | -application.version = "4.9.19" | 53 | +application.version = "5.0.0" |
54 | 54 | ||
55 | ; 网站SEO信息 | 55 | ; 网站SEO信息 |
56 | application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证" | 56 | application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证" |
@@ -50,7 +50,7 @@ application.template.ext = ".phtml" | @@ -50,7 +50,7 @@ application.template.ext = ".phtml" | ||
50 | application.assets.path = ROOT_PATH "/assets/web" | 50 | application.assets.path = ROOT_PATH "/assets/web" |
51 | 51 | ||
52 | ; 应用的版本号 | 52 | ; 应用的版本号 |
53 | -application.version = "4.9.19" | 53 | +application.version = "5.0.0" |
54 | 54 | ||
55 | ; 网站SEO信息 | 55 | ; 网站SEO信息 |
56 | application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证" | 56 | application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证" |
@@ -21,7 +21,7 @@ define('USE_INTER_FACE_SHUNT', false);//分流开关 | @@ -21,7 +21,7 @@ define('USE_INTER_FACE_SHUNT', false);//分流开关 | ||
21 | //define('API_OLD', 'http://test2.open.yohobuy.com/'); | 21 | //define('API_OLD', 'http://test2.open.yohobuy.com/'); |
22 | 22 | ||
23 | #dev环境 | 23 | #dev环境 |
24 | - define('API_URL', 'http://dev-api.yohops.com:9999/'); | 24 | + define('API_URL', 'http://api-test4.yohops.com:9999'); |
25 | define('SERVICE_URL', 'http://dev-service.yohops.com:9999/'); | 25 | define('SERVICE_URL', 'http://dev-service.yohops.com:9999/'); |
26 | define('YOHOBUY_URL', 'http://www.yohobuy.com/'); | 26 | define('YOHOBUY_URL', 'http://www.yohobuy.com/'); |
27 | define('SERVICE_NOTIFY', 'http://test2.open.yohobuy.com/'); | 27 | define('SERVICE_NOTIFY', 'http://test2.open.yohobuy.com/'); |
-
Please register or login to post a comment