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
cailing
9 years ago
Commit
31e21bc551b081e407bdcb72446e7ae7a2f8cd64
1 parent
a6e66ff3
hotrank修改
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
18 deletions
yohobuy/www.yohobuy.com/application/models/Product/Hotrank.php
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php
yohobuy/www.yohobuy.com/application/models/Product/Hotrank.php
View file @
31e21bc
...
...
@@ -110,18 +110,20 @@ class HotrankModel
'gender'
=>
$data
[
'gender'
],
'road'
=>
$data
[
'road'
]);
$list
=
self
::
getSearchData
(
$config
,
$page
,
1
);
$lister
=
$list
[
'hotWeek'
][
'list'
];
$lister
=
array_values
(
$lister
);
if
(
$sid
==
1
&&
$page
==
1
)
{
$lister
=
array_slice
(
$lister
,
10
,
50
);
}
else
{
$lister
=
array_slice
(
$lister
,
0
,
50
);
if
(
!
empty
(
$list
))
{
$lister
=
$list
[
'hotWeek'
][
'list'
];
$lister
=
array_values
(
$lister
);
if
(
$sid
==
1
&&
$page
==
1
)
{
$lister
=
array_slice
(
$lister
,
10
,
50
);
}
else
{
$lister
=
array_slice
(
$lister
,
0
,
50
);
}
$data
=
array
(
'code'
=>
200
,
'data'
=>
$lister
,);
return
$data
;
}
$data
=
array
(
'code'
=>
200
,
'data'
=>
$lister
,);
return
$data
;
}
/**
...
...
@@ -171,6 +173,7 @@ class HotrankModel
}
//根据给定查询数据搜索数据列表
$result
=
SearchData
::
searchElasticByCondition
(
$param
);
//人气单品,一周热卖数据处理
$data
=
self
::
getProductList
(
$result
,
$page
,
$ajax
);
return
$data
;
}
...
...
@@ -208,13 +211,13 @@ class HotrankModel
return
$product
;
}
$data
=
$result
[
'data'
][
'product_list'
];
$popular
=
array
();
$hotWeek
=
array
();
$popular
=
array
();
//一周热卖
$hotWeek
=
array
();
//人气单品
foreach
(
$data
as
$key
=>
$val
)
{
if
(
empty
(
$val
[
'goods_list'
]))
{
continue
;
}
//
$defaultGoodsId = 0;
$defaultGoodsId
=
0
;
foreach
(
$val
[
'goods_list'
]
as
$v
)
{
if
(
$v
[
'is_default'
]
==
'Y'
)
{
$defaultGoodsId
=
empty
(
$v
[
'goods_id'
])
?
$val
[
'goods_list'
][
0
][
'goods_id'
]
:
$v
[
'goods_id'
];
...
...
@@ -226,8 +229,8 @@ class HotrankModel
$product
[
'rank'
]
=
$key
+
1
;
$product
[
'title'
]
=
$val
[
'product_name'
];
$product
[
'href'
]
=
$url
.
'_'
.
$product_id
.
'_'
.
$defaultGoodsId
.
'.html'
;
$product
[
'price'
]
=
(
int
)
$val
[
'market_price'
]
==
(
int
)
$val
[
'sales_price'
]
?
''
:
$val
[
'market_price'
];
$product
[
'sPrice'
]
=
empty
(
$val
[
'sales_price'
])
?
''
:
$val
[
'sales_price'
];
$product
[
'price'
]
=
(
int
)
$val
[
'market_price'
]
==
(
int
)
$val
[
'sales_price'
]
?
false
:
$val
[
'market_price'
];
$product
[
'sPrice'
]
=
empty
(
$val
[
'sales_price'
])
?
false
:
$val
[
'sales_price'
];
if
(
$key
<=
5
)
{
//6张大图
$product
[
'img'
]
=
empty
(
$val
[
'default_images'
])
?
''
:
Images
::
getImageUrl
(
$val
[
'default_images'
],
378
,
504
,
2
);
...
...
@@ -243,8 +246,8 @@ class HotrankModel
//一周热卖
$product
[
'name'
]
=
$val
[
'product_name'
];
$product
[
'url'
]
=
$url
.
'_'
.
$product_id
.
'_'
.
$defaultGoodsId
.
'.html'
;
$product
[
'marketPrice'
]
=
(
int
)
$val
[
'market_price'
]
==
(
int
)
$val
[
'sales_price'
]
?
''
:
$val
[
'market_price'
];
$product
[
'salePrice'
]
=
empty
(
$val
[
'sales_price'
])
?
''
:
$val
[
'sales_price'
];
$product
[
'marketPrice'
]
=
(
int
)
$val
[
'market_price'
]
==
(
int
)
$val
[
'sales_price'
]
?
false
:
$val
[
'market_price'
];
$product
[
'salePrice'
]
=
empty
(
$val
[
'sales_price'
])
?
false
:
$val
[
'sales_price'
];
$product
[
'rank'
]
=
''
;
$product
[
'thumb'
]
=
empty
(
$val
[
'default_images'
])
?
''
:
Images
::
getImageUrl
(
$val
[
'default_images'
],
280
,
373
,
2
);
$hot
[]
=
$product
;
...
...
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php
View file @
31e21bc
...
...
@@ -148,6 +148,7 @@ class IndexController extends WebAction
//获取频道
$channel
=
HotrankModel
::
getChannelResource
();
$this
->
setWebNavHeader
(
$channel
[
'channel'
]);
$this
->
setTitle
(
'热销排行|YOHO!BUY有货'
);
$page
=
$this
->
get
(
'page'
,
1
);
$sort
=
$this
->
get
(
'sid'
,
1
);
$data
=
array
(
'hotrankPage'
=>
true
,
...
...
Please
register
or
login
to post a comment