Merge branch 'release/4.4' of http://git.dev.yoho.cn/web/yohobuy into release/4.4
Showing
6 changed files
with
66 additions
and
15 deletions
@@ -80,30 +80,30 @@ class SearchData | @@ -80,30 +80,30 @@ class SearchData | ||
80 | return 'http://192.168.102.216:8087/yohosearch/search.json'; | 80 | return 'http://192.168.102.216:8087/yohosearch/search.json'; |
81 | case 'testing': | 81 | case 'testing': |
82 | if ($type == 'sort') { | 82 | if ($type == 'sort') { |
83 | - return 'http://10.66.100.4:8080/yohosearch/sortgroup.json'; | 83 | + return 'http://testing.yohoops.org/yohosearch/sortgroup.json'; |
84 | } | 84 | } |
85 | elseif ($type == 'discount') { | 85 | elseif ($type == 'discount') { |
86 | - return 'http://10.66.100.4:8080/yohosearch/discount.json'; | 86 | + return 'http://testing.yohoops.org/yohosearch/discount.json'; |
87 | } | 87 | } |
88 | elseif ($type == 'recent') { | 88 | elseif ($type == 'recent') { |
89 | - return 'http://10.66.100.4:8080/yohosearch/recent.json'; | 89 | + return 'http://testing.yohoops.org/yohosearch/recent.json'; |
90 | } | 90 | } |
91 | elseif ($type == 'suggest') { | 91 | elseif ($type == 'suggest') { |
92 | - return 'http://10.66.100.4:8080/yohosearch/suggest.json'; | 92 | + return 'http://testing.yohoops.org/yohosearch/suggest.json'; |
93 | } | 93 | } |
94 | else if($type == 'new-shelve') { | 94 | else if($type == 'new-shelve') { |
95 | - return 'http://10.66.100.4:8080/yohosearch/new-shelve.json'; | 95 | + return 'http://testing.yohoops.org/yohosearch/new-shelve.json'; |
96 | } | 96 | } |
97 | elseif ($type == 'shop') { | 97 | elseif ($type == 'shop') { |
98 | - return 'http://10.66.100.4:8080/yohosearch/shops.json'; | 98 | + return 'http://testing.yohoops.org/yohosearch/shops.json'; |
99 | } | 99 | } |
100 | elseif ($type == 'search') { | 100 | elseif ($type == 'search') { |
101 | - return 'http://10.66.100.4:8080/yohosearch/search.json'; | 101 | + return 'http://testing.yohoops.org/yohosearch/search.json'; |
102 | } | 102 | } |
103 | elseif ($type == 'brand') { | 103 | elseif ($type == 'brand') { |
104 | - return 'http://10.66.100.4:8080/yohosearch/brand/list.json'; | 104 | + return 'http://testing.yohoops.org/yohosearch/brand/list.json'; |
105 | } | 105 | } |
106 | - return 'http://10.66.100.4:8080/yohosearch/search.json'; | 106 | + return 'http://testing.yohoops.org/yohosearch/search.json'; |
107 | case 'developer': | 107 | case 'developer': |
108 | default: | 108 | default: |
109 | if ($type == 'sort') { | 109 | if ($type == 'sort') { |
@@ -594,4 +594,18 @@ class SearchData | @@ -594,4 +594,18 @@ class SearchData | ||
594 | { | 594 | { |
595 | return Yohobuy::get(self::getUrl(), $param); | 595 | return Yohobuy::get(self::getUrl(), $param); |
596 | } | 596 | } |
597 | + /** | ||
598 | + * 根据品牌id查询店铺列表接口 | ||
599 | + * @param type array $param | ||
600 | + * @return type [] | ||
601 | + */ | ||
602 | + public static function getQueryShopsByBrandId($brandId) | ||
603 | + { | ||
604 | + $param = Yohobuy::param(); | ||
605 | + $param['method'] = 'app.shop.queryShopsByBrandId'; | ||
606 | + $param['brand_id'] = $brandId; | ||
607 | + $param['client_secret'] = Sign::getSign($param); | ||
608 | + | ||
609 | + return Yohobuy::get(Yohobuy::API_URL, $param); | ||
610 | + } | ||
597 | } | 611 | } |
@@ -596,7 +596,7 @@ class HelperSearch | @@ -596,7 +596,7 @@ class HelperSearch | ||
596 | //已选中品牌标签名 | 596 | //已选中品牌标签名 |
597 | $existName = array(); | 597 | $existName = array(); |
598 | foreach ($brand as $key => $v) { | 598 | foreach ($brand as $key => $v) { |
599 | - if (!$v['brand_alif']) { | 599 | + if (empty($v['brand_alif'])) { |
600 | $v['brand_alif'] = substr($v['brand_name_en'], 0, 1); | 600 | $v['brand_alif'] = substr($v['brand_name_en'], 0, 1); |
601 | if (!$v['brand_alif']) { | 601 | if (!$v['brand_alif']) { |
602 | $pinyin = self::pinYin($v['brand_name']); | 602 | $pinyin = self::pinYin($v['brand_name']); |
@@ -106,6 +106,10 @@ class ShopModel | @@ -106,6 +106,10 @@ class ShopModel | ||
106 | $searchCondition['userInput'] = empty($searchCondition['userInput']) ? array() : $searchCondition['userInput']; | 106 | $searchCondition['userInput'] = empty($searchCondition['userInput']) ? array() : $searchCondition['userInput']; |
107 | $param = array_merge($searchCondition['userInput'], array('navBar' => 1)); | 107 | $param = array_merge($searchCondition['userInput'], array('navBar' => 1)); |
108 | $data['allGoods']['list'] = $result['goods']; | 108 | $data['allGoods']['list'] = $result['goods']; |
109 | + $data['allGoods']['navs'][] = array( | ||
110 | + 'name' => 'MORE', | ||
111 | + 'href' => self::$shopListUrl | ||
112 | + ); | ||
109 | $data['allGoods']['name'] = '全部商品 ALL'; | 113 | $data['allGoods']['name'] = '全部商品 ALL'; |
110 | $data['allGoods']['opts'] = $result['opts']; | 114 | $data['allGoods']['opts'] = $result['opts']; |
111 | $data['leftContent'] = isset($result['leftContent']) ? $result['leftContent'] : ''; | 115 | $data['leftContent'] = isset($result['leftContent']) ? $result['leftContent'] : ''; |
@@ -443,11 +447,44 @@ class ShopModel | @@ -443,11 +447,44 @@ class ShopModel | ||
443 | */ | 447 | */ |
444 | public static function goodsTabBar($data) | 448 | public static function goodsTabBar($data) |
445 | { | 449 | { |
446 | - $result = array(); | ||
447 | - | ||
448 | - if (isset($data['resource_data'])) { | ||
449 | - $result = $data['resource_data']; | 450 | + $more = array( |
451 | + 'name' => 'MORE', | ||
452 | + 'href' => self::$shopListUrl | ||
453 | + ); | ||
454 | + $result = array( | ||
455 | + 'hot' => array(), | ||
456 | + 'new' => array() | ||
457 | + ); | ||
458 | + if (empty($data['resource_data'])) { | ||
459 | + return $result; | ||
460 | + } | ||
461 | + | ||
462 | + if (isset($data['resource_data']['hot'])) { | ||
463 | + foreach ($data['resource_data']['hot'] as $val) { | ||
464 | + if (empty($val['url'])) { | ||
465 | + continue; | ||
466 | + } | ||
467 | + $result['hot'][] = array( | ||
468 | + 'name' => $val['name'], | ||
469 | + 'href' => 'http://' . trim($val['url'], 'http://'), | ||
470 | + ); | ||
471 | + } | ||
450 | } | 472 | } |
473 | + | ||
474 | + if (isset($data['resource_data']['new'])) { | ||
475 | + foreach ($data['resource_data']['new'] as $val) { | ||
476 | + if (empty($val['url'])) { | ||
477 | + continue; | ||
478 | + } | ||
479 | + $result['new'][] = array( | ||
480 | + 'name' => $val['name'], | ||
481 | + 'href' => 'http://' . trim($val['url'], 'http://'), | ||
482 | + ); | ||
483 | + } | ||
484 | + } | ||
485 | + | ||
486 | + $result['hot'][] = $more; | ||
487 | + $result['new'][] = $more; | ||
451 | return $result; | 488 | return $result; |
452 | } | 489 | } |
453 | 490 |
-
Please register or login to post a comment