添加对浏览记录和收藏的商品中下架商品的处理
Code Review By Rock Zhang
Showing
1 changed file
with
4 additions
and
2 deletions
@@ -238,6 +238,7 @@ class UserModel | @@ -238,6 +238,7 @@ class UserModel | ||
238 | $product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥' . Helpers::transPrice($val['sales_price']) : false; | 238 | $product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥' . Helpers::transPrice($val['sales_price']) : false; |
239 | $product['savePrice'] = ($val['price_down'] > 0) ? '¥' . Helpers::transPrice($val['price_down']) : false; | 239 | $product['savePrice'] = ($val['price_down'] > 0) ? '¥' . Helpers::transPrice($val['price_down']) : false; |
240 | $product['sellOut'] = ($val['storage'] <= 0); | 240 | $product['sellOut'] = ($val['storage'] <= 0); |
241 | + $product['invalidGoods'] = ($val['status'] == 0); // 下架商品 | ||
241 | 242 | ||
242 | $datas[] = $product; | 243 | $datas[] = $product; |
243 | } | 244 | } |
@@ -378,9 +379,9 @@ class UserModel | @@ -378,9 +379,9 @@ class UserModel | ||
378 | $record = array(); | 379 | $record = array(); |
379 | foreach ($data as &$val) { | 380 | foreach ($data as &$val) { |
380 | // 排除下架的商品 | 381 | // 排除下架的商品 |
381 | - if ($val['status'] == 0) { | 382 | + /*if ($val['status'] == 0) { |
382 | continue; | 383 | continue; |
383 | - } | 384 | + }*/ |
384 | 385 | ||
385 | $record = array(); | 386 | $record = array(); |
386 | $record['product_name'] = $val['product_name']; | 387 | $record['product_name'] = $val['product_name']; |
@@ -389,6 +390,7 @@ class UserModel | @@ -389,6 +390,7 @@ class UserModel | ||
389 | $record['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 447, 596) : ''; | 390 | $record['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 447, 596) : ''; |
390 | $record['sales_price'] = Helpers::transPrice($val['sales_price']); | 391 | $record['sales_price'] = Helpers::transPrice($val['sales_price']); |
391 | $record['market_price'] = ($val['market_price'] - $val['sales_price'] > 0) ? Helpers::transPrice($val['market_price']) : false; | 392 | $record['market_price'] = ($val['market_price'] - $val['sales_price'] > 0) ? Helpers::transPrice($val['market_price']) : false; |
393 | + $record['invalidGoods'] = ($val['status'] == 0); // 下架商品 | ||
392 | $record['storage'] = $val['storage']; | 394 | $record['storage'] = $val['storage']; |
393 | $allRecords[] = $record; | 395 | $allRecords[] = $record; |
394 | } | 396 | } |
-
Please register or login to post a comment