Authored by Rock Zhang

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

Code Review By Rock Zhang
@@ -218,6 +218,7 @@ class UserModel @@ -218,6 +218,7 @@ class UserModel
218 $product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥' . Helpers::transPrice($val['sales_price']) : false; 218 $product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥' . Helpers::transPrice($val['sales_price']) : false;
219 $product['savePrice'] = ($val['price_down'] > 0) ? '¥' . Helpers::transPrice($val['price_down']) : false; 219 $product['savePrice'] = ($val['price_down'] > 0) ? '¥' . Helpers::transPrice($val['price_down']) : false;
220 $product['sellOut'] = ($val['storage'] <= 0); 220 $product['sellOut'] = ($val['storage'] <= 0);
  221 + $product['invalidGoods'] = ($val['status'] == 0); // 下架商品
221 222
222 $datas[] = $product; 223 $datas[] = $product;
223 } 224 }
@@ -358,9 +359,9 @@ class UserModel @@ -358,9 +359,9 @@ class UserModel
358 $record = array(); 359 $record = array();
359 foreach ($data as &$val) { 360 foreach ($data as &$val) {
360 // 排除下架的商品 361 // 排除下架的商品
361 - if ($val['status'] == 0) { 362 + /*if ($val['status'] == 0) {
362 continue; 363 continue;
363 - } 364 + }*/
364 365
365 $record = array(); 366 $record = array();
366 $record['product_name'] = $val['product_name']; 367 $record['product_name'] = $val['product_name'];
@@ -369,6 +370,7 @@ class UserModel @@ -369,6 +370,7 @@ class UserModel
369 $record['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 447, 596) : ''; 370 $record['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 447, 596) : '';
370 $record['sales_price'] = Helpers::transPrice($val['sales_price']); 371 $record['sales_price'] = Helpers::transPrice($val['sales_price']);
371 $record['market_price'] = ($val['market_price'] - $val['sales_price'] > 0) ? Helpers::transPrice($val['market_price']) : false; 372 $record['market_price'] = ($val['market_price'] - $val['sales_price'] > 0) ? Helpers::transPrice($val['market_price']) : false;
  373 + $record['invalidGoods'] = ($val['status'] == 0); // 下架商品
372 $record['storage'] = $val['storage']; 374 $record['storage'] = $val['storage'];
373 $allRecords[] = $record; 375 $allRecords[] = $record;
374 } 376 }