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
Email Patches
Plain Diff
Browse Files
Authored by
Rock Zhang
9 years ago
Commit
ce73a93b5b183a881b7ed9512f9472be2c1d371b
1 parent
e996e8e9
修改浏览记录不显示的bug
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
3 deletions
yohobuy/m.yohobuy.com/application/models/Index/User.php
yohobuy/m.yohobuy.com/application/models/Index/User.php
View file @
ce73a93
...
...
@@ -273,7 +273,7 @@ class UserModel
* @param int $udid 客户端唯一标识
* @param int $page 第几页,默认为1
* @param int $limit 限制多少条,默认100
* @return array处理之后的数据
* @return array
处理之后的数据
*/
public
static
function
browserRecord
(
$uid
,
$udid
,
$page
,
$limit
)
{
...
...
@@ -281,9 +281,30 @@ class UserModel
$records
=
UserData
::
browseRecord
(
$uid
,
$udid
,
$page
,
$limit
);
if
(
!
$records
)
{
$result
[
'walkwayUrl'
]
=
'/product/new'
;
$result
[
'noRecord'
]
=
true
;
return
$result
;
}
// 处理数据
if
(
isset
(
$records
[
'data'
][
'product_list'
])
&&
!
empty
(
$records
[
'data'
][
'product_list'
]))
{
$result
=
$records
[
'data'
][
'product_list'
];
if
(
isset
(
$records
[
'data'
][
'product_list'
]))
{
// 不能再查到结果了
if
(
$page
==
1
&&
$records
[
'data'
][
'total'
]
===
0
)
{
$result
[
'walkwayUrl'
]
=
'/product/new'
;
$result
[
'noRecord'
]
=
true
;
}
else
{
$data
=
$records
[
'data'
][
'product_list'
];
foreach
(
$data
as
&
$val
)
{
$val
[
'image'
]
=
Helpers
::
getImageUrl
(
$val
[
'image'
],
140
,
140
);
$val
[
'sales_price'
]
=
!
empty
(
$val
[
'sales_price'
])
?
$val
[
'sales_price'
]
.
'.00'
:
0
;
$val
[
'market_price'
]
=
!
empty
(
$val
[
'market_price'
])
?
$val
[
'market_price'
]
.
'.00'
:
0
;
}
!
empty
(
$data
)
&&
$result
[
'browseRecord'
]
=
$data
;
}
}
return
$result
;
...
...
Please
register
or
login
to post a comment