Authored by Rock Zhang

添加对浏览记录和收藏的商品中下架商品的处理

Code Review By Rock Zhang
... ... @@ -218,6 +218,7 @@ class UserModel
$product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥' . Helpers::transPrice($val['sales_price']) : false;
$product['savePrice'] = ($val['price_down'] > 0) ? '¥' . Helpers::transPrice($val['price_down']) : false;
$product['sellOut'] = ($val['storage'] <= 0);
$product['invalidGoods'] = ($val['status'] == 0); // 下架商品
$datas[] = $product;
}
... ... @@ -358,9 +359,9 @@ class UserModel
$record = array();
foreach ($data as &$val) {
// 排除下架的商品
if ($val['status'] == 0) {
/*if ($val['status'] == 0) {
continue;
}
}*/
$record = array();
$record['product_name'] = $val['product_name'];
... ... @@ -369,6 +370,7 @@ class UserModel
$record['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 447, 596) : '';
$record['sales_price'] = Helpers::transPrice($val['sales_price']);
$record['market_price'] = ($val['market_price'] - $val['sales_price'] > 0) ? Helpers::transPrice($val['market_price']) : false;
$record['invalidGoods'] = ($val['status'] == 0); // 下架商品
$record['storage'] = $val['storage'];
$allRecords[] = $record;
}
... ...