修复收藏的品牌或者商品,在获取后面页数接口没返回时会出现无数据提示的bug
Code Review By Rock Zhang
Showing
1 changed file
with
2 additions
and
2 deletions
@@ -201,7 +201,7 @@ class UserModel | @@ -201,7 +201,7 @@ class UserModel | ||
201 | $datas[] = $product; | 201 | $datas[] = $product; |
202 | } | 202 | } |
203 | !empty($datas) && $result['hasFavProduct'] = $datas; | 203 | !empty($datas) && $result['hasFavProduct'] = $datas; |
204 | - } else if ($page > 1 && isset($favProduct['code']) && $favProduct['code'] === 500) { | 204 | + } else if ($page > 1 && (!$favProduct || (isset($favProduct['code']) && $favProduct['code'] === 500))) { |
205 | $result['end'] = true; | 205 | $result['end'] = true; |
206 | } | 206 | } |
207 | 207 | ||
@@ -259,7 +259,7 @@ class UserModel | @@ -259,7 +259,7 @@ class UserModel | ||
259 | $datas[] = $brand; | 259 | $datas[] = $brand; |
260 | } | 260 | } |
261 | !empty($datas) && $result['hasFavBrand'] = $datas; | 261 | !empty($datas) && $result['hasFavBrand'] = $datas; |
262 | - } else if ($page > 1 && isset($favBrand['code']) && $favBrand['code'] === 500) { | 262 | + } else if ($page > 1 && (!$favBrand || (isset($favBrand['code']) && $favBrand['code'] === 500))) { |
263 | $result['end'] = true; | 263 | $result['end'] = true; |
264 | } | 264 | } |
265 | 265 |
-
Please register or login to post a comment