Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
hf
9 years ago
Commit
e67683f38c5e86014de3455ca871b917bc6d6a12
1 parent
a5d8ea1f
fixes bug refs YW-933
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
55 additions
and
13 deletions
library/Plugin/Helpers.php
script/nginx/conf/vhosts/nginx.test.yohobuy.conf
yohobuy/m.yohobuy.com/application/controllers/Search.php
yohobuy/m.yohobuy.com/application/modules/Guang/controllers/Info.php
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Recom.php
yohobuy/m.yohobuy.com/configs/routes.index.ini
library/Plugin/Helpers.php
View file @
e67683f
...
...
@@ -175,9 +175,11 @@ class Helpers
* @param bool $showTag 控制是否显示标签
* @param bool $showNew 控制是否显示NEW图标
* @param bool $showSale 控制是否显示SALE图标
* @param int $width 图片的宽度
* @param int $height 图片的高度
* @return array | false
*/
public
static
function
formatProduct
(
$productData
,
$showTags
=
true
,
$showNew
=
true
,
$showSale
=
true
)
public
static
function
formatProduct
(
$productData
,
$showTags
=
true
,
$showNew
=
true
,
$showSale
=
true
,
$width
=
290
,
$height
=
388
)
{
// 商品信息有问题,则不显示
if
(
!
isset
(
$productData
[
'product_skn'
])
||
!
isset
(
$productData
[
'goods_list'
][
0
]))
{
...
...
@@ -197,7 +199,7 @@ class Helpers
$result
=
array
();
$result
[
'id'
]
=
$productData
[
'product_skn'
];
$result
[
'product_id'
]
=
$productData
[
'product_id'
];
$result
[
'thumb'
]
=
Images
::
getImageUrl
(
$productData
[
'default_images'
],
235
,
314
);
$result
[
'thumb'
]
=
Images
::
getImageUrl
(
$productData
[
'default_images'
],
$width
,
$height
);
$result
[
'name'
]
=
$productData
[
'product_name'
];
$result
[
'price'
]
=
$productData
[
'market_price'
];
$result
[
'salePrice'
]
=
$productData
[
'sales_price'
];
...
...
script/nginx/conf/vhosts/nginx.test.yohobuy.conf
View file @
e67683f
...
...
@@ -17,33 +17,71 @@ server
allow
172
.
16
.
0
.
0
/
16
;
deny
all
;
# 子域名
if
($
host
=
"sale.test.yoho.cn"
) {
rewrite
^/(.*)$
http
://
m
.
yohobuy
.
com
/$
1
permanent
;
proxy_redirect
off
;
proxy_pass
http
://
61
.
155
.
222
.
162
;
proxy_set_header
Host
cuxiao
.
m
.
yohobuy
.
com
;
proxy_set_header
X
-
Real
-
IP
$
remote_addr
;
proxy_set_header
X
-
Forwarded
-
For
$
proxy_add_x_forwarded_for
;
proxy_set_header
Accept
-
Encoding
"gzip"
;
}
if
($
host
=
"cuxiao.test.yoho.cn"
) {
rewrite
^/(.*)$
http
://
m
.
yohobuy
.
com
/$
1
permanent
;
proxy_redirect
off
;
proxy_pass
http
://
101
.
201
.
176
.
121
;
proxy_set_header
Host
cuxiao
.
m
.
yohobuy
.
com
;
proxy_set_header
X
-
Real
-
IP
$
remote_addr
;
proxy_set_header
X
-
Forwarded
-
For
$
proxy_add_x_forwarded_for
;
proxy_set_header
Accept
-
Encoding
"gzip"
;
}
# 账号相关
location
=/
signin
.
html
{
rewrite
^/(.*)$
http
://
m
.
yohobuy
.
com
/$
1
permanent
;
proxy_redirect
off
;
proxy_pass
http
://
61
.
155
.
222
.
163
;
proxy_set_header
Host
m
.
yohobuy
.
com
;
proxy_set_header
X
-
Real
-
IP
$
remote_addr
;
proxy_set_header
X
-
Forwarded
-
For
$
proxy_add_x_forwarded_for
;
proxy_set_header
Accept
-
Encoding
"gzip"
;
}
location
/
passport
/
auth
{
rewrite
^/(.*)$
http
://
m
.
yohobuy
.
com
/$
1
permanent
;
proxy_redirect
off
;
proxy_pass
http
://
61
.
155
.
222
.
163
;
proxy_set_header
Host
m
.
yohobuy
.
com
;
proxy_set_header
X
-
Real
-
IP
$
remote_addr
;
proxy_set_header
X
-
Forwarded
-
For
$
proxy_add_x_forwarded_for
;
proxy_set_header
Accept
-
Encoding
"gzip"
;
}
location
/
passport
/
signin
{
rewrite
^/(.*)$
http
://
m
.
yohobuy
.
com
/$
1
permanent
;
proxy_redirect
off
;
proxy_pass
http
://
61
.
155
.
222
.
163
;
proxy_set_header
Host
m
.
yohobuy
.
com
;
proxy_set_header
X
-
Real
-
IP
$
remote_addr
;
proxy_set_header
X
-
Forwarded
-
For
$
proxy_add_x_forwarded_for
;
proxy_set_header
Accept
-
Encoding
"gzip"
;
}
# 个人中心
location
/
home
{
rewrite
^/(.*)$
http
://
m
.
yohobuy
.
com
/$
1
permanent
;
proxy_redirect
off
;
proxy_pass
http
://
61
.
155
.
222
.
163
;
proxy_set_header
Host
m
.
yohobuy
.
com
;
proxy_set_header
X
-
Real
-
IP
$
remote_addr
;
proxy_set_header
X
-
Forwarded
-
For
$
proxy_add_x_forwarded_for
;
proxy_set_header
Accept
-
Encoding
"gzip"
;
}
# 购物车
location
/
cart
{
rewrite
^/(.*)$
http
://
m
.
yohobuy
.
com
/$
1
permanent
;
proxy_redirect
off
;
proxy_pass
http
://
61
.
155
.
222
.
163
;
proxy_set_header
Host
m
.
yohobuy
.
com
;
proxy_set_header
X
-
Real
-
IP
$
remote_addr
;
proxy_set_header
X
-
Forwarded
-
For
$
proxy_add_x_forwarded_for
;
proxy_set_header
Accept
-
Encoding
"gzip"
;
}
location
~* \.
html
$ {
...
...
yohobuy/m.yohobuy.com/application/controllers/Search.php
View file @
e67683f
...
...
@@ -122,6 +122,8 @@ class SearchController extends AbstractAction
}
while
(
false
);
$classNames
=
array
();
}
else
{
$condition
[
'query'
]
=
''
;
}
$data
=
array
();
...
...
yohobuy/m.yohobuy.com/application/modules/Guang/controllers/Info.php
View file @
e67683f
...
...
@@ -99,7 +99,7 @@ class InfoController extends AbstractAction
if
(
$i
>
3
)
{
break
;
}
$good
[]
=
Helpers
::
formatProduct
(
$goods
,
false
);
$good
[]
=
Helpers
::
formatProduct
(
$goods
,
false
,
true
,
true
,
235
,
314
);
}
}
// 没有商品
...
...
@@ -130,7 +130,7 @@ class InfoController extends AbstractAction
$product
=
ListData
::
productInfoBySkns
(
$skns
);
if
(
!
empty
(
$product
[
'data'
][
'product_list'
]))
{
foreach
(
$product
[
'data'
][
'product_list'
]
as
$i
=>
$goods
)
{
$good
[
'goods'
][]
=
Helpers
::
formatProduct
(
$goods
,
false
);
$good
[
'goods'
][]
=
Helpers
::
formatProduct
(
$goods
,
false
,
true
,
true
,
235
,
314
);
}
$build
[
'collocation'
][]
=
$good
;
}
...
...
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Recom.php
View file @
e67683f
...
...
@@ -56,7 +56,7 @@ class RecomController extends AbstractAction
/* 构建商品数据 */
$data
=
array
();
foreach
(
$recom
[
'data'
][
'product_list'
]
as
$value
)
{
$data
[
'goods'
][]
=
Helpers
::
formatProduct
(
$value
,
true
);
$data
[
'goods'
][]
=
Helpers
::
formatProduct
(
$value
,
true
,
true
,
true
,
276
,
366
);
}
$this
->
_view
->
display
(
'maylike'
,
$data
);
}
while
(
false
);
...
...
yohobuy/m.yohobuy.com/configs/routes.index.ini
View file @
e67683f
...
...
@@ -14,7 +14,7 @@ routes.error.route.action = Index
; 搜索页
routes.search.type
=
"rewrite"
routes.search.match
=
"/
search.html
"
routes.search.match
=
"/
(search.html|search)$
"
routes.search.route.module
=
Index
routes.search.route.controller
=
Search
routes.search.route.action
=
Index
...
...
Please
register
or
login
to post a comment