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
Plain Diff
Browse Files
Authored by
whb
9 years ago
Commit
5b7cd21f597547f0e67e19c4d62c4540c4d76d97
2 parents
55f0896e
0f8c3a8c
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
17 deletions
library/LibModels/Wap/Product/SearchData.php
library/Plugin/Helpers.php
library/LibModels/Wap/Product/SearchData.php
View file @
5b7cd21
...
...
@@ -29,12 +29,13 @@ class SearchData
defined
(
'APPLICATION_ENV'
)
||
define
(
'APPLICATION_ENV'
,
'developer'
);
switch
(
APPLICATION_ENV
)
{
case
'release'
:
return
'http://100.98.132.63/yohosearch/search.json'
;
case
'test'
:
return
'http://100.98.132.63/yohosearch/search.json'
;
//return 'http://101.201.178.220/yohosearch/search.json';
case
'preview'
:
return
'http://101.200.31.165/yohosearch/search.json'
;
case
'test'
:
case
'developer'
:
default
:
return
'http://1
01.200.31.165/yohosearch/search.json'
;
//return 'http://1
92.168.10.64:8080/yohosearch/search.json';
return
'http://192.168.10.64:8080/yohosearch/search.json'
;
}
}
...
...
library/Plugin/Helpers.php
View file @
5b7cd21
...
...
@@ -218,14 +218,10 @@ class Helpers
$productData
[
'market_price'
]
=
false
;
}
$flag
=
false
;
// 判别默认的商品是否将默认的图片URL赋值到skn
$firstGood
=
array
();
// 第一个skc产品
// 判别默认的商品是否将默认的图片URL赋值到skn
$flag
=
false
;
// 如果设置了默认图片,就取默认的图片
foreach
(
$productData
[
'goods_list'
]
as
$oneGoods
)
{
if
(
empty
(
$firstGood
))
{
$firstGood
=
$oneGoods
;
}
// 此skc是默认的,则将图片赋值给skn
if
(
$oneGoods
[
'is_default'
]
===
'Y'
)
{
$productData
[
'default_images'
]
=
self
::
procProductImg
(
$oneGoods
);
...
...
@@ -233,8 +229,8 @@ class Helpers
}
}
// 如果还未赋值,则取第一个skc产品的默认图片
if
(
!
$flag
&&
!
empty
(
$firstGood
))
{
$productDatap
[
'default_images'
]
=
self
::
procProductImg
(
$firstGood
);
if
(
!
$flag
)
{
$productData
[
'default_images'
]
=
self
::
procProductImg
(
$productData
[
'goods_list'
][
0
]);
}
$result
=
array
();
...
...
@@ -286,12 +282,15 @@ class Helpers
}
/**
* 根据性别来决定 默认图片获取字段 如果是 2、3 则优先从cover2 --》 cover1 -- 》 images_url
* 否则优先从cover1 --》 cover2 -- 》 images_url
* 根据性别来决定 默认图片获取字段 如果是 2、3
*
* 则优先从cover2 --》 cover1 -- 》 images_url
* 否则优先从cover1 --》 cover2 -- 》 images_url
*
* @param array $images
* @return string 商品图片
*/
p
rivate
static
function
procProductImg
(
$images
)
p
ublic
static
function
procProductImg
(
$images
)
{
$imgUrl
=
isset
(
$images
[
'images_url'
])
?
$images
[
'images_url'
]
:
''
;
$cover1
=
isset
(
$images
[
'cover_1'
])
?
$images
[
'cover_1'
]
:
''
;
...
...
@@ -800,7 +799,7 @@ class Helpers
*/
public
static
function
syncUserSession
(
$uid
,
$refer
=
''
,
$callback
=
'call'
)
{
return
'http://m
1
.yohobuy.com/Passport/session/index?callback='
.
$callback
return
'http://m
api
.yohobuy.com/Passport/session/index?callback='
.
$callback
.
'&sign='
.
md5
(
md5
(
$uid
.
'Js8Yn0!EwPM45-ws'
))
.
'&uid='
.
$uid
.
'&go='
.
$refer
;
}
...
...
@@ -816,7 +815,7 @@ class Helpers
*/
public
static
function
logoutSession
(
$token
,
$refer
=
''
,
$callback
=
'call'
)
{
return
'http://m
1
.yohobuy.com/Passport/session/logout?callback='
.
$callback
return
'http://m
api
.yohobuy.com/Passport/session/logout?callback='
.
$callback
.
'&sign='
.
md5
(
md5
(
'Js8Yn0!EwPM45-ws'
))
.
'&token='
.
$token
.
'&go='
.
$refer
;
}
...
...
@@ -858,7 +857,7 @@ class Helpers
*/
public
static
function
makeMobile
(
$area
,
$mobile
){
if
(
empty
(
$area
)
||
$area
==
86
){
return
$mobile
;
return
$mobile
;
}
return
$area
.
'-'
.
$mobile
;
}
...
...
Please
register
or
login
to post a comment