Authored by 毕凯

Merge branch 'release/4.8'

@@ -649,8 +649,8 @@ function addcart(data, cookieList) { @@ -649,8 +649,8 @@ function addcart(data, cookieList) {
649 path: '/' 649 path: '/'
650 }); 650 });
651 } 651 }
652 - } else if (d.code === 500) {  
653 - new Alert(d.message).show(); 652 + } else {
  653 + new Alert(d.message === '' ? '加入购物车失败哦~~' : d.message).show();
654 } 654 }
655 }); 655 });
656 } 656 }
@@ -322,6 +322,8 @@ $addToCart.click(function() { @@ -322,6 +322,8 @@ $addToCart.click(function() {
322 $('#balance').slideDown(SLIDETIME); 322 $('#balance').slideDown(SLIDETIME);
323 323
324 $('#cart-num').text(data.data.goods_count); //更新数目 324 $('#cart-num').text(data.data.goods_count); //更新数目
  325 + } else {
  326 + new Alert(data.message === '' ? '加入购物车失败哦~~' : data.message).show();
325 } 327 }
326 }); 328 });
327 }); 329 });
@@ -508,7 +508,7 @@ class CartModel @@ -508,7 +508,7 @@ class CartModel
508 $build['img'] = Helpers::getImageUrl($value['default_images'], 100, 100); 508 $build['img'] = Helpers::getImageUrl($value['default_images'], 100, 100);
509 $build['alt'] = $value['product_name']; 509 $build['alt'] = $value['product_name'];
510 $build['price'] = strstr(strval($value['sales_price']), '.') ? $value['sales_price'] : $value['sales_price'] . '.00'; 510 $build['price'] = strstr(strval($value['sales_price']), '.') ? $value['sales_price'] : $value['sales_price'] . '.00';
511 - if ($value['sales_price'] !== ['market_price']) { 511 + if ($value['sales_price'] !== $value['market_price']) {
512 $build['marketPrice'] = strstr(strval($value['market_price']), '.') ? $value['market_price'] : $value['market_price'] . '.00'; 512 $build['marketPrice'] = strstr(strval($value['market_price']), '.') ? $value['market_price'] : $value['market_price'] . '.00';
513 } 513 }
514 514