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
Rock Zhang
9 years ago
Commit
eff60aa1f78474984bb6394b0baafd75277fc81d
1 parent
1b3c82ed
修复收藏的品牌以及商品会1限循环的bug(接口返回数据格式变化导致)
Code Review By Rock Zhang
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
yohobuy/m.yohobuy.com/application/models/Index/User.php
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
View file @
eff60aa
...
...
@@ -633,8 +633,15 @@ class CartModel
$data
=
array
();
$data
[
'name'
]
=
$productData
[
'product_name'
];
$data
[
'price'
]
=
$productData
[
'format_market_price'
];
$data
[
'salePrice'
]
=
$productData
[
'format_sales_price'
];
if
(
isset
(
$productData
[
'special_price'
]))
{
// 加价购或者赠品的销售价字段
$data
[
'price'
]
=
$productData
[
'format_market_price'
];
$data
[
'salePrice'
]
=
$productData
[
'format_sales_price'
];
}
else
{
// 购物车商品的销售价字段
$data
[
'price'
]
=
$productData
[
'market_price'
]
>
$productData
[
'sales_price'
]
?
$productData
[
'format_market_price'
]
:
false
;
$data
[
'salePrice'
]
=
'¥'
.
Helpers
::
transPrice
(
$productData
[
'sales_price'
]);
}
if
(
isset
(
$productData
[
'storage_sum'
]))
{
$data
[
'storage'
]
=
$productData
[
'storage_sum'
];
...
...
yohobuy/m.yohobuy.com/application/models/Index/User.php
View file @
eff60aa
...
...
@@ -188,7 +188,7 @@ class UserModel
$favProduct
=
UserData
::
favoriteProductData
(
$uid
,
$page
,
$limit
);
// 处理用户收藏的商品数据
if
(
isset
(
$favProduct
[
'data'
])
&&
!
empty
(
$favProduct
[
'data'
][
'product_list'
])
)
{
if
(
isset
(
$favProduct
[
'data'
])
&&
$page
<=
$favProduct
[
'data'
][
'page_total'
]
)
{
$datas
=
array
();
$product
=
array
();
foreach
(
$favProduct
[
'data'
][
'product_list'
]
as
$val
)
{
...
...
@@ -210,7 +210,7 @@ class UserModel
$datas
[]
=
$product
;
}
!
empty
(
$datas
)
&&
$result
[
'hasFavProduct'
]
=
$datas
;
}
else
if
(
$page
>
1
&&
!
isset
(
$favProduct
[
'data'
][
'product_list'
])
)
{
}
else
if
(
(
$page
>
1
&&
!
$favProduct
)
||
$page
>
$favProduct
[
'data'
][
'page_total'
]
)
{
$result
[
'end'
]
=
true
;
}
...
...
@@ -234,7 +234,7 @@ class UserModel
$favBrand
=
UserData
::
favoriteBrandData
(
$uid
,
$gender
,
$page
,
$limit
);
// 处理用户收藏的品牌数据
if
(
isset
(
$favBrand
[
'data'
])
&&
!
empty
(
$favBrand
[
'data'
][
'brand_list'
])
)
{
if
(
isset
(
$favBrand
[
'data'
])
&&
$page
<=
$favBrand
[
'data'
][
'page_total'
]
)
{
$datas
=
array
();
$brand
=
array
();
foreach
(
$favBrand
[
'data'
][
'brand_list'
]
as
$val
)
{
...
...
@@ -265,7 +265,7 @@ class UserModel
$datas
[]
=
$brand
;
}
!
empty
(
$datas
)
&&
$result
[
'hasFavBrand'
]
=
$datas
;
}
else
if
(
$page
>
1
&&
!
isset
(
$favBrand
[
'code'
][
'brand_list'
])
)
{
}
else
if
(
(
$page
>
1
&&
!
$favBrand
)
||
$page
>
$favBrand
[
'data'
][
'page_total'
]
)
{
$result
[
'end'
]
=
true
;
}
...
...
Please
register
or
login
to post a comment