fixes bug to guang detail page brand link click
Showing
9 changed files
with
47 additions
and
38 deletions
@@ -17,16 +17,16 @@ use Plugin\Cache; | @@ -17,16 +17,16 @@ use Plugin\Cache; | ||
17 | class Yohobuy | 17 | class Yohobuy |
18 | { | 18 | { |
19 | 19 | ||
20 | - /* 正式环境 */ | ||
21 | - const API_URL = 'http://api2.open.yohobuy.com/'; | ||
22 | - const SERVICE_URL = 'http://service.api.yohobuy.com/'; | ||
23 | - const YOHOBUY_URL = 'http://www.yohobuy.com/'; | ||
24 | - | ||
25 | -// /* 测试环境 */ | ||
26 | -// const API_URL = 'http://test2.open.yohobuy.com/'; | ||
27 | -// const SERVICE_URL = 'http://test.service.api.yohobuy.com/'; | 20 | +// /* 正式环境 */ |
21 | +// const API_URL = 'http://api2.open.yohobuy.com/'; | ||
22 | +// const SERVICE_URL = 'http://service.api.yohobuy.com/'; | ||
28 | // const YOHOBUY_URL = 'http://www.yohobuy.com/'; | 23 | // const YOHOBUY_URL = 'http://www.yohobuy.com/'; |
29 | 24 | ||
25 | + /* 测试环境 */ | ||
26 | + const API_URL = 'http://test2.open.yohobuy.com/'; | ||
27 | + const SERVICE_URL = 'http://test.service.api.yohobuy.com/'; | ||
28 | + const YOHOBUY_URL = 'http://www.yohobuy.com/'; | ||
29 | + | ||
30 | /** | 30 | /** |
31 | * 私钥列表 | 31 | * 私钥列表 |
32 | * | 32 | * |
@@ -73,7 +73,6 @@ class SearchController extends AbstractAction | @@ -73,7 +73,6 @@ class SearchController extends AbstractAction | ||
73 | 'discount' => FILTER_VALIDATE_INT, | 73 | 'discount' => FILTER_VALIDATE_INT, |
74 | 'gender' => FILTER_DEFAULT, | 74 | 'gender' => FILTER_DEFAULT, |
75 | 'p_d' => FILTER_DEFAULT,), false); | 75 | 'p_d' => FILTER_DEFAULT,), false); |
76 | - | ||
77 | $query = isset($condition['query']) ? strtolower(trim($condition['query'])) : null; | 76 | $query = isset($condition['query']) ? strtolower(trim($condition['query'])) : null; |
78 | 77 | ||
79 | // 标识用户是否有输入搜索内容 | 78 | // 标识用户是否有输入搜索内容 |
@@ -117,10 +116,10 @@ class SearchController extends AbstractAction | @@ -117,10 +116,10 @@ class SearchController extends AbstractAction | ||
117 | // 跳转到品牌商品列表页 | 116 | // 跳转到品牌商品列表页 |
118 | if ($domain !== null) { | 117 | if ($domain !== null) { |
119 | $url = Helpers::url('', array( | 118 | $url = Helpers::url('', array( |
120 | - 'from' => 'search', | ||
121 | - 'query' => $query, | ||
122 | - 'gender' => $condition['gender'] | ||
123 | - ), $domain); | 119 | + 'from' => 'search', |
120 | + 'query' => $query, | ||
121 | + 'gender' => $condition['gender'] | ||
122 | + ), $domain); | ||
124 | $this->go($url); | 123 | $this->go($url); |
125 | } | 124 | } |
126 | } | 125 | } |
@@ -234,14 +233,15 @@ class SearchController extends AbstractAction | @@ -234,14 +233,15 @@ class SearchController extends AbstractAction | ||
234 | } | 233 | } |
235 | 234 | ||
236 | $data = array(); | 235 | $data = array(); |
237 | - // 查询数据 | 236 | + // 查询品类数据 |
238 | if (!isset($condition['query'])) { | 237 | if (!isset($condition['query'])) { |
239 | - $data += Product\ListModel::getClassData($condition); | 238 | + $data += Product\ListModel::getClassData($condition, $order, $page); |
240 | if (isset($data['filter'])) { | 239 | if (isset($data['filter'])) { |
241 | unset($data['filter']); | 240 | unset($data['filter']); |
242 | } | 241 | } |
243 | - } else { | ||
244 | - // 查询数据 | 242 | + } |
243 | + // 查询数据 | ||
244 | + else { | ||
245 | $listData = SearchData::searchByCondition($condition, $order, $page); | 245 | $listData = SearchData::searchByCondition($condition, $order, $page); |
246 | // 处理返回的数据 | 246 | // 处理返回的数据 |
247 | if (isset($listData['data'])) { | 247 | if (isset($listData['data'])) { |
@@ -150,7 +150,7 @@ class PlusstarModel | @@ -150,7 +150,7 @@ class PlusstarModel | ||
150 | if (isset($value['data'][1])) { | 150 | if (isset($value['data'][1])) { |
151 | $imgs = array(); | 151 | $imgs = array(); |
152 | foreach ($value['data'] as $ps) { | 152 | foreach ($value['data'] as $ps) { |
153 | - $build['url'] = '/guang/plusstar/detail?id=' . $value['id'] . '&gender=' . $gender; | 153 | + $build['url'] = Helpers::url('/plustar/brandinfo', array('id' => $value['id'], 'gender' => $gender), 'guang'); |
154 | $build['img'] = Helpers::getImageUrl($ps['src'], 640, 310); | 154 | $build['img'] = Helpers::getImageUrl($ps['src'], 640, 310); |
155 | $build['deps'] = $showSummary ? $value['brand_title'] : false; | 155 | $build['deps'] = $showSummary ? $value['brand_title'] : false; |
156 | $imgs[] = $build; | 156 | $imgs[] = $build; |
@@ -159,7 +159,7 @@ class PlusstarModel | @@ -159,7 +159,7 @@ class PlusstarModel | ||
159 | } | 159 | } |
160 | // 情况2: 单张图 | 160 | // 情况2: 单张图 |
161 | elseif (isset($value['data'][0])) { | 161 | elseif (isset($value['data'][0])) { |
162 | - $build['url'] = '/guang/plusstar/detail?id=' . $value['id'] . '&gender=' . $gender; | 162 | + $build['url'] = Helpers::url('/plustar/brandinfo', array('id' => $value['id'], 'gender' => $gender), 'guang'); |
163 | $build['img'] = Helpers::getImageUrl($value['data'][0]['src'], 640, 310); | 163 | $build['img'] = Helpers::getImageUrl($value['data'][0]['src'], 640, 310); |
164 | $build['deps'] = $showSummary ? $value['brand_title'] : false; | 164 | $build['deps'] = $showSummary ? $value['brand_title'] : false; |
165 | $result[] = $build; | 165 | $result[] = $build; |
@@ -82,9 +82,18 @@ class PlusstarController extends AbstractAction | @@ -82,9 +82,18 @@ class PlusstarController extends AbstractAction | ||
82 | if (empty($brandInfo['getBrandInfo']['data']['brand_id'])) { | 82 | if (empty($brandInfo['getBrandInfo']['data']['brand_id'])) { |
83 | break; | 83 | break; |
84 | } | 84 | } |
85 | - | 85 | + $brandId = $brandInfo['getBrandInfo']['data']['brand_id']; |
86 | + | ||
87 | + /* 获取更多品牌的链接 */ | ||
88 | + $url = '/brands'; | ||
89 | + $brandDomains = Product\ListModel::getAllBrandDomains(); | ||
90 | + if (isset($brandDomains[$brandId])) { | ||
91 | + // 构建成 品牌域名.xxx.com | ||
92 | + $url = Helpers::url('', null, $brandDomains[$brandId]); | ||
93 | + } | ||
94 | + | ||
86 | $data['psDetail'] = true; | 95 | $data['psDetail'] = true; |
87 | - $data['ps']['id'] = $brandInfo['getBrandInfo']['data']['brand_id']; | 96 | + $data['ps']['id'] = $brandId; |
88 | $data['ps']['banner'] = Helpers::getImageUrl($brandInfo['getBrandInfo']['data']['cover_img'], 640, 309); | 97 | $data['ps']['banner'] = Helpers::getImageUrl($brandInfo['getBrandInfo']['data']['cover_img'], 640, 309); |
89 | $data['ps']['logo'] = Helpers::getImageUrl($brandInfo['getBrandInfo']['data']['brand_ico'], 160, 160); | 98 | $data['ps']['logo'] = Helpers::getImageUrl($brandInfo['getBrandInfo']['data']['brand_ico'], 160, 160); |
90 | $data['ps']['name'] = $brandInfo['getBrandInfo']['data']['brand_name']; | 99 | $data['ps']['name'] = $brandInfo['getBrandInfo']['data']['brand_name']; |
@@ -92,7 +101,7 @@ class PlusstarController extends AbstractAction | @@ -92,7 +101,7 @@ class PlusstarController extends AbstractAction | ||
92 | $data['ps']['likeUrl'] = false; //"http://guang.m.yohobuy.com/plustar/brandinfo?id=285&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http:\/\/guang.m.yohobuy.com\/plustar\/brandinfo","param":{"id":285}},"requesturl":{"url":"\/guang\/api\/v1\/favorite\/togglebrand","param":{"brand_id":"701"}},"priority":"Y"}}"; | 101 | $data['ps']['likeUrl'] = false; //"http://guang.m.yohobuy.com/plustar/brandinfo?id=285&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http:\/\/guang.m.yohobuy.com\/plustar\/brandinfo","param":{"id":285}},"requesturl":{"url":"\/guang\/api\/v1\/favorite\/togglebrand","param":{"brand_id":"701"}},"priority":"Y"}}"; |
93 | $data['ps']['intro'] = empty($brandInfo['getBrandInfo']['data']['brand_intro']) ? '' : strtr(strip_tags($brandInfo['getBrandInfo']['data']['brand_intro']), array(' ' => ' ')); | 102 | $data['ps']['intro'] = empty($brandInfo['getBrandInfo']['data']['brand_intro']) ? '' : strtr(strip_tags($brandInfo['getBrandInfo']['data']['brand_intro']), array(' ' => ' ')); |
94 | $data['ps']['newArrival'] = array(); | 103 | $data['ps']['newArrival'] = array(); |
95 | - $data['ps']['newArrival']['moreUrl'] = '/product/list/brand?brand=' . $id; // @todo 品牌列表页面 | 104 | + $data['ps']['newArrival']['moreUrl'] = $url; |
96 | $data['ps']['newArrival']['naList'] = $brandInfo['getNewProduct']; | 105 | $data['ps']['newArrival']['naList'] = $brandInfo['getNewProduct']; |
97 | $data['ps']['infos'] = array(); | 106 | $data['ps']['infos'] = array(); |
98 | 107 |
@@ -50,4 +50,4 @@ application.template.ext = ".phtml" | @@ -50,4 +50,4 @@ application.template.ext = ".phtml" | ||
50 | application.assets.path = ROOT_PATH "/assets" | 50 | application.assets.path = ROOT_PATH "/assets" |
51 | 51 | ||
52 | ; 应用的版本号 | 52 | ; 应用的版本号 |
53 | -application.version = "0.0.2" | ||
53 | +application.version = "0.0.3" |
@@ -50,4 +50,4 @@ application.template.ext = ".phtml" | @@ -50,4 +50,4 @@ application.template.ext = ".phtml" | ||
50 | application.assets.path = ROOT_PATH "/assets" | 50 | application.assets.path = ROOT_PATH "/assets" |
51 | 51 | ||
52 | ; 应用的版本号 | 52 | ; 应用的版本号 |
53 | -application.version = "0.0.2" | ||
53 | +application.version = "0.0.3" |
@@ -50,4 +50,4 @@ application.template.ext = ".phtml" | @@ -50,4 +50,4 @@ application.template.ext = ".phtml" | ||
50 | application.assets.path = ROOT_PATH "/assets" | 50 | application.assets.path = ROOT_PATH "/assets" |
51 | 51 | ||
52 | ; 应用的版本号 | 52 | ; 应用的版本号 |
53 | -application.version = "0.0.2" | ||
53 | +application.version = "0.0.3" |
@@ -12,17 +12,17 @@ routes.author.route.module = Guang | @@ -12,17 +12,17 @@ routes.author.route.module = Guang | ||
12 | routes.author.route.controller = Index | 12 | routes.author.route.controller = Index |
13 | routes.author.route.action = Editor | 13 | routes.author.route.action = Editor |
14 | 14 | ||
15 | -; 国际优选 | ||
16 | -routes.author.type = "rewrite" | ||
17 | -routes.author.match = "/plustar" | ||
18 | -routes.author.route.module = Guang | ||
19 | -routes.author.route.controller = Plusstar | ||
20 | -routes.author.route.action = Index | 15 | +; 国际优选/明星原创 |
16 | +routes.plusstar.type = "rewrite" | ||
17 | +routes.plusstar.match = "/(plustar|plustar/index)$" | ||
18 | +routes.plusstar.route.module = Guang | ||
19 | +routes.plusstar.route.controller = Plusstar | ||
20 | +routes.plusstar.route.action = Index | ||
21 | 21 | ||
22 | -; 明星原创 | ||
23 | -routes.author.type = "rewrite" | ||
24 | -routes.author.match = "/(plustar|plustar/index)" | ||
25 | -routes.author.route.module = Guang | ||
26 | -routes.author.route.controller = Plusstar | ||
27 | -routes.author.route.action = Index | 22 | +; 国际优选/明星原创详情 |
23 | +routes.brandinfo.type = "rewrite" | ||
24 | +routes.brandinfo.match = "/(plustar/brandinfo)$" | ||
25 | +routes.brandinfo.route.module = Guang | ||
26 | +routes.brandinfo.route.controller = Plusstar | ||
27 | +routes.brandinfo.route.action = detail | ||
28 | 28 |
-
Please register or login to post a comment