Showing
6 changed files
with
55 additions
and
13 deletions
@@ -175,9 +175,11 @@ class Helpers | @@ -175,9 +175,11 @@ class Helpers | ||
175 | * @param bool $showTag 控制是否显示标签 | 175 | * @param bool $showTag 控制是否显示标签 |
176 | * @param bool $showNew 控制是否显示NEW图标 | 176 | * @param bool $showNew 控制是否显示NEW图标 |
177 | * @param bool $showSale 控制是否显示SALE图标 | 177 | * @param bool $showSale 控制是否显示SALE图标 |
178 | + * @param int $width 图片的宽度 | ||
179 | + * @param int $height 图片的高度 | ||
178 | * @return array | false | 180 | * @return array | false |
179 | */ | 181 | */ |
180 | - public static function formatProduct($productData, $showTags = true, $showNew = true, $showSale = true) | 182 | + public static function formatProduct($productData, $showTags = true, $showNew = true, $showSale = true, $width = 290, $height = 388) |
181 | { | 183 | { |
182 | // 商品信息有问题,则不显示 | 184 | // 商品信息有问题,则不显示 |
183 | if (!isset($productData['product_skn']) || !isset($productData['goods_list'][0])) { | 185 | if (!isset($productData['product_skn']) || !isset($productData['goods_list'][0])) { |
@@ -197,7 +199,7 @@ class Helpers | @@ -197,7 +199,7 @@ class Helpers | ||
197 | $result = array(); | 199 | $result = array(); |
198 | $result['id'] = $productData['product_skn']; | 200 | $result['id'] = $productData['product_skn']; |
199 | $result['product_id'] = $productData['product_id']; | 201 | $result['product_id'] = $productData['product_id']; |
200 | - $result['thumb'] = Images::getImageUrl($productData['default_images'], 235, 314); | 202 | + $result['thumb'] = Images::getImageUrl($productData['default_images'], $width, $height); |
201 | $result['name'] = $productData['product_name']; | 203 | $result['name'] = $productData['product_name']; |
202 | $result['price'] = $productData['market_price']; | 204 | $result['price'] = $productData['market_price']; |
203 | $result['salePrice'] = $productData['sales_price']; | 205 | $result['salePrice'] = $productData['sales_price']; |
@@ -17,33 +17,71 @@ server | @@ -17,33 +17,71 @@ server | ||
17 | allow 172.16.0.0/16; | 17 | allow 172.16.0.0/16; |
18 | deny all; | 18 | deny all; |
19 | 19 | ||
20 | + | ||
21 | + | ||
22 | + | ||
20 | # 子域名 | 23 | # 子域名 |
21 | if ($host = "sale.test.yoho.cn" ) { | 24 | if ($host = "sale.test.yoho.cn" ) { |
22 | - rewrite ^/(.*)$ http://m.yohobuy.com/$1 permanent; | 25 | + proxy_redirect off; |
26 | + proxy_pass http://61.155.222.162; | ||
27 | + proxy_set_header Host cuxiao.m.yohobuy.com; | ||
28 | + proxy_set_header X-Real-IP $remote_addr; | ||
29 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
30 | + proxy_set_header Accept-Encoding "gzip"; | ||
23 | } | 31 | } |
24 | if ($host = "cuxiao.test.yoho.cn" ) { | 32 | if ($host = "cuxiao.test.yoho.cn" ) { |
25 | - rewrite ^/(.*)$ http://m.yohobuy.com/$1 permanent; | 33 | + proxy_redirect off; |
34 | + proxy_pass http://101.201.176.121; | ||
35 | + proxy_set_header Host cuxiao.m.yohobuy.com; | ||
36 | + proxy_set_header X-Real-IP $remote_addr; | ||
37 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
38 | + proxy_set_header Accept-Encoding "gzip"; | ||
26 | } | 39 | } |
27 | 40 | ||
28 | # 账号相关 | 41 | # 账号相关 |
29 | location =/signin.html { | 42 | location =/signin.html { |
30 | - rewrite ^/(.*)$ http://m.yohobuy.com/$1 permanent; | 43 | + proxy_redirect off; |
44 | + proxy_pass http://61.155.222.163; | ||
45 | + proxy_set_header Host m.yohobuy.com; | ||
46 | + proxy_set_header X-Real-IP $remote_addr; | ||
47 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
48 | + proxy_set_header Accept-Encoding "gzip"; | ||
31 | } | 49 | } |
32 | location /passport/auth { | 50 | location /passport/auth { |
33 | - rewrite ^/(.*)$ http://m.yohobuy.com/$1 permanent; | 51 | + proxy_redirect off; |
52 | + proxy_pass http://61.155.222.163; | ||
53 | + proxy_set_header Host m.yohobuy.com; | ||
54 | + proxy_set_header X-Real-IP $remote_addr; | ||
55 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
56 | + proxy_set_header Accept-Encoding "gzip"; | ||
34 | } | 57 | } |
35 | location /passport/signin { | 58 | location /passport/signin { |
36 | - rewrite ^/(.*)$ http://m.yohobuy.com/$1 permanent; | 59 | + proxy_redirect off; |
60 | + proxy_pass http://61.155.222.163; | ||
61 | + proxy_set_header Host m.yohobuy.com; | ||
62 | + proxy_set_header X-Real-IP $remote_addr; | ||
63 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
64 | + proxy_set_header Accept-Encoding "gzip"; | ||
37 | } | 65 | } |
38 | 66 | ||
39 | # 个人中心 | 67 | # 个人中心 |
40 | location /home { | 68 | location /home { |
41 | - rewrite ^/(.*)$ http://m.yohobuy.com/$1 permanent; | 69 | + proxy_redirect off; |
70 | + proxy_pass http://61.155.222.163; | ||
71 | + proxy_set_header Host m.yohobuy.com; | ||
72 | + proxy_set_header X-Real-IP $remote_addr; | ||
73 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
74 | + proxy_set_header Accept-Encoding "gzip"; | ||
42 | } | 75 | } |
43 | 76 | ||
44 | # 购物车 | 77 | # 购物车 |
45 | location /cart { | 78 | location /cart { |
46 | - rewrite ^/(.*)$ http://m.yohobuy.com/$1 permanent; | 79 | + proxy_redirect off; |
80 | + proxy_pass http://61.155.222.163; | ||
81 | + proxy_set_header Host m.yohobuy.com; | ||
82 | + proxy_set_header X-Real-IP $remote_addr; | ||
83 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
84 | + proxy_set_header Accept-Encoding "gzip"; | ||
47 | } | 85 | } |
48 | 86 | ||
49 | location ~* \.html$ { | 87 | location ~* \.html$ { |
@@ -122,6 +122,8 @@ class SearchController extends AbstractAction | @@ -122,6 +122,8 @@ class SearchController extends AbstractAction | ||
122 | } while (false); | 122 | } while (false); |
123 | 123 | ||
124 | $classNames = array(); | 124 | $classNames = array(); |
125 | + } else { | ||
126 | + $condition['query'] = ''; | ||
125 | } | 127 | } |
126 | 128 | ||
127 | $data = array(); | 129 | $data = array(); |
@@ -99,7 +99,7 @@ class InfoController extends AbstractAction | @@ -99,7 +99,7 @@ class InfoController extends AbstractAction | ||
99 | if ($i > 3) { | 99 | if ($i > 3) { |
100 | break; | 100 | break; |
101 | } | 101 | } |
102 | - $good[] = Helpers::formatProduct($goods, false); | 102 | + $good[] = Helpers::formatProduct($goods, false, true, true, 235,314); |
103 | } | 103 | } |
104 | } | 104 | } |
105 | // 没有商品 | 105 | // 没有商品 |
@@ -130,7 +130,7 @@ class InfoController extends AbstractAction | @@ -130,7 +130,7 @@ class InfoController extends AbstractAction | ||
130 | $product = ListData::productInfoBySkns($skns); | 130 | $product = ListData::productInfoBySkns($skns); |
131 | if (!empty($product['data']['product_list'])) { | 131 | if (!empty($product['data']['product_list'])) { |
132 | foreach ($product['data']['product_list'] as $i => $goods) { | 132 | foreach ($product['data']['product_list'] as $i => $goods) { |
133 | - $good['goods'][] = Helpers::formatProduct($goods, false); | 133 | + $good['goods'][] = Helpers::formatProduct($goods, false, true, true, 235,314); |
134 | } | 134 | } |
135 | $build['collocation'][] = $good; | 135 | $build['collocation'][] = $good; |
136 | } | 136 | } |
@@ -56,7 +56,7 @@ class RecomController extends AbstractAction | @@ -56,7 +56,7 @@ class RecomController extends AbstractAction | ||
56 | /* 构建商品数据 */ | 56 | /* 构建商品数据 */ |
57 | $data = array(); | 57 | $data = array(); |
58 | foreach ($recom['data']['product_list'] as $value) { | 58 | foreach ($recom['data']['product_list'] as $value) { |
59 | - $data['goods'][] = Helpers::formatProduct($value, true); | 59 | + $data['goods'][] = Helpers::formatProduct($value, true, true, true, 276, 366); |
60 | } | 60 | } |
61 | $this->_view->display('maylike', $data); | 61 | $this->_view->display('maylike', $data); |
62 | } while (false); | 62 | } while (false); |
@@ -14,7 +14,7 @@ routes.error.route.action = Index | @@ -14,7 +14,7 @@ routes.error.route.action = Index | ||
14 | 14 | ||
15 | ; 搜索页 | 15 | ; 搜索页 |
16 | routes.search.type = "rewrite" | 16 | routes.search.type = "rewrite" |
17 | -routes.search.match = "/search.html" | 17 | +routes.search.match = "/(search.html|search)$" |
18 | routes.search.route.module = Index | 18 | routes.search.route.module = Index |
19 | routes.search.route.controller = Search | 19 | routes.search.route.controller = Search |
20 | routes.search.route.action = Index | 20 | routes.search.route.action = Index |
-
Please register or login to post a comment