Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
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
Plain Diff
Browse Files
Authored by
xuqi
9 years ago
Commit
258010df455ee0caf1337989240e2ac74af35854
2 parents
fceff7e3
d0d754b9
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
75 deletions
library/LibModels/Wap/Product/NewsaleData.php
library/Plugin/DataProcess/ListProcess.php
library/Plugin/DataProcess/NewSaleProcess.php
template/m.yohobuy.com/partials/home/floor_header_more.phtml
yohobuy/m.yohobuy.com/application/models/Product/Newsale.php
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Newsale.php
library/LibModels/Wap/Product/NewsaleData.php
View file @
258010d
...
...
@@ -56,25 +56,10 @@ class NewsaleData
$param
[
'limit'
]
=
$limit
;
$param
[
'yh_channel'
]
=
$channel
;
$build
=
$param
;
$build
[
'dayLimit'
]
=
1
;
$build
[
'client_secret'
]
=
Sign
::
getSign
(
$build
);
$urlList
[
'new'
]
=
Yohobuy
::
httpBuildQuery
(
Yohobuy
::
API_URL
,
$build
);
$build
=
$param
;
$build
[
'dayLimit'
]
=
2
;
$build
[
'client_secret'
]
=
Sign
::
getSign
(
$build
);
$urlList
[
'week'
]
=
Yohobuy
::
httpBuildQuery
(
Yohobuy
::
API_URL
,
$build
);
$build
=
$param
;
$build
[
'dayLimit'
]
=
3
;
$build
[
'client_secret'
]
=
Sign
::
getSign
(
$build
);
$urlList
[
'sale'
]
=
Yohobuy
::
httpBuildQuery
(
Yohobuy
::
API_URL
,
$build
);
$build
=
array
();
$param
=
array
();
$param
[
'dayLimit'
]
=
1
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
get
Multi
(
$urlList
);
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
}
/**
...
...
@@ -147,13 +132,10 @@ class NewsaleData
$param
[
'limit'
]
=
$limit
;
$param
[
'yh_channel'
]
=
$channel
;
// 构建url地址列表
$urlList
=
array
();
$param
[
'p_d'
]
=
'0.1,0.9'
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
$urlList
[
'ALL'
]
=
Yohobuy
::
httpBuildQuery
(
Yohobuy
::
API_URL
,
$param
);
return
Yohobuy
::
get
Multi
(
$urlList
);
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
}
/**
...
...
library/Plugin/DataProcess/ListProcess.php
View file @
258010d
...
...
@@ -198,7 +198,7 @@ class ListProcess
$result
=
array
(
'title'
=>
'品类'
,
'name'
=>
'所有品类'
,
'dataType'
=>
'
m
sort'
,
'dataType'
=>
'sort'
,
'subs'
=>
array
(
array
(
'chosed'
=>
true
,
...
...
library/Plugin/DataProcess/NewSaleProcess.php
View file @
258010d
...
...
@@ -20,50 +20,32 @@ class NewSaleProcess
public
static
function
newSaleData
(
$products
)
{
$result
=
array
();
$noTab
=
true
;
$productsLi
=
array
();
$tabItem
=
array
();
foreach
(
$products
as
$single
)
{
if
(
empty
(
$single
))
{
continue
;
}
// 处理Filter
if
(
isset
(
$single
[
'filter'
]))
{
$result
[
'filter'
]
=
ListProcess
::
getFilterData
(
$single
[
'filter'
]);
}
// 处理Tabs
$noTab
=
true
;
if
(
isset
(
$single
[
'tabs'
])
&&
$noTab
)
{
$result
[
'tabs'
]
=
array
();
foreach
(
$single
[
'tabs'
]
as
$key
=>
$one
)
{
$tabItem
=
array
();
$tabItem
[
'title'
]
=
$one
;
$tabItem
[
'dataId'
]
=
$key
;
if
(
$key
===
1
)
{
$tabItem
[
'focus'
]
=
true
;
}
$result
[
'tabs'
][]
=
$tabItem
;
// 处理Tabs
if
(
isset
(
$products
[
'tabs'
]))
{
$result
[
'tabs'
]
=
array
();
foreach
(
$products
[
'tabs'
]
as
$key
=>
$one
)
{
$tabItem
=
array
();
$tabItem
[
'title'
]
=
$one
;
$tabItem
[
'dataId'
]
=
$key
;
if
(
$key
===
1
)
{
$tabItem
[
'focus'
]
=
true
;
}
$
noTab
=
false
;
$
result
[
'tabs'
][]
=
$tabItem
;
}
}
// 处理商品
$productsLi
=
array
();
if
(
isset
(
$single
[
'product_list'
]))
{
foreach
(
$single
[
'product_list'
]
as
$value
)
{
$productsLi
[
'goods'
][]
=
Helpers
::
formatProduct
(
$value
,
true
,
false
,
false
);
}
}
// 处理Filter
if
(
isset
(
$products
[
'filter'
]))
{
$result
[
'filter'
]
=
ListProcess
::
getFilterData
(
$products
[
'filter'
]);
}
// 对于第一个productsLi添加show字段
if
(
!
isset
(
$result
[
'goodsContainer'
][
0
]))
{
$productsLi
[
'show'
]
=
true
;
}
// 处理商品
if
(
isset
(
$products
[
'product_list'
]))
{
foreach
(
$products
[
'product_list'
]
as
$single
)
{
$result
[
'goodsContainer'
][]
=
$productsLi
;
$result
[
'goods'
][]
=
Helpers
::
formatProduct
(
$single
,
true
,
false
,
false
);
}
}
return
$result
;
...
...
template/m.yohobuy.com/partials/home/floor_header_more.phtml
View file @
258010d
{
{#
title
}
}
<div
class=
"floor-header-more"
>
<h
2
>
{
{title
}
}</h
2
>
<a
class=
"more-btn iconfont"
href=
"{{more_url}}"
>
{
{more_name
}
}
</a>
<a
class=
"more-btn iconfont"
href=
"{{more_url}}"
>

618
;
</a>
</div>
{
{/
title
}
}
\ No newline at end of file
...
...
yohobuy/m.yohobuy.com/application/models/Product/Newsale.php
View file @
258010d
...
...
@@ -117,8 +117,8 @@ class NewsaleModel
}
/* 格式化商品数据 */
if
(
!
empty
(
$products
))
{
$result
=
NewSaleProcess
::
newSaleData
(
$products
);
if
(
isset
(
$products
[
'code'
])
&&
$products
[
'code'
]
==
200
)
{
$result
=
NewSaleProcess
::
newSaleData
(
$products
[
'data'
]);
}
return
$result
;
...
...
@@ -154,8 +154,8 @@ class NewsaleModel
}
/* 格式化商品数据 */
if
(
!
empty
(
$products
))
{
$result
=
NewSaleProcess
::
newSaleData
(
$products
);
if
(
isset
(
$products
[
'code'
])
&&
$products
[
'code'
]
==
200
)
{
$result
=
NewSaleProcess
::
newSaleData
(
$products
[
'data'
]);
}
return
$result
;
...
...
@@ -170,6 +170,8 @@ class NewsaleModel
*/
private
static
function
cacheControl
(
$cacheKey
,
$codeKey
)
{
$result
=
array
();
if
(
USE_CACHE
)
{
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result
=
Cache
::
get
(
$cacheKey
,
'master'
);
...
...
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Newsale.php
View file @
258010d
...
...
@@ -32,11 +32,11 @@ class NewsaleController extends AbstractAction
}
// 设置一些筛选的默认参数
$data
+=
array
(
'brand'
=>
0
,
'msort'
=>
0
,
'brand'
=>
'0'
,
'sort'
=>
'0'
,
'gender'
=>
Helpers
::
getGenderByCookie
(),
'price'
=>
0
,
'size'
=>
0
,
'price'
=>
'0'
,
'size'
=>
'0'
,
'dayLimit'
=>
1
,
'discount'
=>
''
);
...
...
@@ -65,11 +65,11 @@ class NewsaleController extends AbstractAction
}
// 设置一些筛选的默认参数
$data
+=
array
(
'brand'
=>
0
,
'msort'
=>
0
,
'brand'
=>
'0'
,
'sort'
=>
'0'
,
'gender'
=>
Helpers
::
getGenderByCookie
(),
'price'
=>
0
,
'size'
=>
0
,
'price'
=>
'0'
,
'size'
=>
'0'
,
'discount'
=>
'0.1,0.9'
);
//var_dump($data);exit;
...
...
@@ -86,7 +86,7 @@ class NewsaleController extends AbstractAction
if
(
$this
->
isAjax
())
{
$gender
=
$this
->
get
(
'gender'
,
'boys'
);
$brand
=
$this
->
get
(
'brand'
,
null
);
$sort
=
$this
->
get
(
'
m
sort'
,
null
);
$sort
=
$this
->
get
(
'sort'
,
null
);
$color
=
$this
->
get
(
'color'
,
null
);
$size
=
$this
->
get
(
'size'
,
null
);
$price
=
$this
->
get
(
'price'
,
null
);
...
...
Please
register
or
login
to post a comment