Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wangshusheng
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
whb
9 years ago
Commit
bf02b2e4acbee82525319aa8f0a790bd9f04abee
1 parent
55c18e72
修改搜索的
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
9 deletions
library/LibModels/Web/Product/SearchData.php
library/LibModels/Web/Product/SearchData.php
View file @
bf02b2e
...
...
@@ -17,22 +17,43 @@ class SearchData extends \LibModels\Wap\Product\SearchData
defined
(
'APPLICATION_ENV'
)
||
define
(
'APPLICATION_ENV'
,
'developer'
);
switch
(
APPLICATION_ENV
)
{
case
'release'
:
if
(
$type
==
'sort'
)
{
return
'http://101.201.178.220/yohosearch/sortgroup.json'
;
}
elseif
(
$type
==
'discount'
)
{
return
'http://101.201.178.220/yohosearch/discount.json'
;
}
elseif
(
$type
==
'recent'
)
{
return
'http://101.201.178.220/yohosearch/recent.json'
;
}
elseif
(
$type
==
'suggest'
)
{
return
'http://101.201.178.220/yohosearch/suggest.json'
;
}
else
if
(
$type
==
'new-shelve'
)
{
return
'http://101.201.178.220/yohosearch/new-shelve.json'
;
}
elseif
(
$type
==
'shop'
)
{
return
'http://101.201.178.220/yohosearch/shops.json'
;
}
return
'http://101.201.178.220/yohosearch/search.json'
;
case
'preview'
:
if
(
$type
==
'sort'
)
{
return
'http://10
0.98.132.63
/yohosearch/sortgroup.json'
;
return
'http://10
1.200.31.165
/yohosearch/sortgroup.json'
;
}
elseif
(
$type
==
'discount'
)
{
return
'http://10
0.98.132.63
/yohosearch/discount.json'
;
return
'http://10
1.200.31.165
/yohosearch/discount.json'
;
}
elseif
(
$type
==
'recent'
)
{
return
'http://10
0.98.132.63
/yohosearch/recent.json'
;
return
'http://10
1.200.31.165
/yohosearch/recent.json'
;
}
elseif
(
$type
==
'suggest'
)
{
//return 'http://101.200.31.165/yohosearch/suggest.json';
return
'http://100.98.132.63/yohosearch/suggest.json'
;
return
'http://101.200.31.165/yohosearch/suggest.json'
;
}
else
if
(
$type
==
'new-shelve'
)
{
return
'http://101.200.31.165/yohosearch/new-shelve.json'
;
}
elseif
(
$type
==
'shop'
)
{
return
'http://10
0.98.132.63
/yohosearch/shops.json'
;
return
'http://10
1.200.31.165
/yohosearch/shops.json'
;
}
return
'http://101.200.31.165/yohosearch/search.json'
;
case
'test'
:
...
...
@@ -54,6 +75,9 @@ class SearchData extends \LibModels\Wap\Product\SearchData
// return 'http://101.200.31.165/yohosearch/suggest.json';
return
'http://182.92.99.119:8080/yohosearch/suggest.json'
;
}
else
if
(
$type
==
'new-shelve'
)
{
return
'http://182.92.99.119:8080/yohosearch/new-shelve.json'
;
}
elseif
(
$type
==
'shop'
)
{
//return 'http://101.200.31.165/yohosearch/shops.json';
return
'http://182.92.99.119:8080/yohosearch/shops.json'
;
...
...
@@ -174,8 +198,13 @@ class SearchData extends \LibModels\Wap\Product\SearchData
foreach
(
$sortList
as
$key
=>
$value
)
{
$lastIndex
=
$value
[
'viewNum'
]
-
1
;
// 业务逻辑:一个品类不满指定个数时,前台不显示
if
(
!
empty
(
$searchd
[
$key
])
&&
isset
(
$searchd
[
$key
][
'product_list'
][
$lastIndex
]))
{
$data
=
array_merge
(
$data
,
$searchd
[
$key
][
'product_list'
]);
if
(
!
empty
(
$searchd
[
$key
]))
{
if
(
isset
(
$searchd
[
$key
][
'product_list'
][
$lastIndex
]))
{
//search
$data
=
array_merge
(
$data
,
$searchd
[
$key
][
'product_list'
]);
}
else
if
(
isset
(
$searchd
[
$key
][
$lastIndex
]))
{
//new-shelve
$data
=
array_merge
(
$data
,
$searchd
[
$key
]);
}
}
}
// 用完清空不使用的变量
...
...
@@ -197,7 +226,7 @@ class SearchData extends \LibModels\Wap\Product\SearchData
$option
=
array
();
foreach
(
$sortList
as
$key
=>
$value
)
{
$option
=
$params
+
$value
;
$urlList
[
$key
]
=
Yohobuy
::
httpBuildQuery
(
self
::
getUrl
(
'
search
'
),
$option
);
$urlList
[
$key
]
=
Yohobuy
::
httpBuildQuery
(
self
::
getUrl
(
'
new-shelve
'
),
$option
);
}
return
$urlList
;
}
...
...
Please
register
or
login
to post a comment