From 4727b294eb5e606d877a237ec75437b26831f45a Mon Sep 17 00:00:00 2001 From: Devil Date: Wed, 9 Oct 2019 23:25:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=AD=E7=89=A9=E8=BD=A6=E8=A7=84=E6=A0=BC?= =?UTF-8?q?=E5=A4=B1=E6=95=88=E5=95=86=E5=93=81=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/view/default/cart/index.html | 11 +++++++---- application/service/BuyService.php | 7 +++++-- public/static/index/default/js/cart.js | 4 ++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/application/index/view/default/cart/index.html b/application/index/view/default/cart/index.html index 723453693..39655ce3e 100755 --- a/application/index/view/default/cart/index.html +++ b/application/index/view/default/cart/index.html @@ -32,10 +32,10 @@ {{foreach $cart_list as $goods}} - +
@@ -73,10 +73,13 @@ +
{{if $goods['is_shelves'] neq 1}} -

商品已下架

+

商品已下架

{{/if}} {{if $goods['is_delete_time'] neq 0}} -

商品已作废

+

商品已作废

+ {{/if}} + {{if isset($goods['is_invalid']) and $goods['is_invalid'] eq 1}} +

商品已失效

{{/if}} diff --git a/application/service/BuyService.php b/application/service/BuyService.php index 5143070df..24b86c522 100755 --- a/application/service/BuyService.php +++ b/application/service/BuyService.php @@ -195,7 +195,6 @@ class BuyService $field = 'c.*, g.inventory_unit, g.is_shelves, g.is_delete_time, g.buy_min_number, g.buy_max_number, g.model'; $data = Db::name('Cart')->alias('c')->join(['__GOODS__'=>'g'], 'g.id=c.goods_id')->where($where)->field($field)->order('c.id desc')->select(); - // 数据处理 if(!empty($data)) { @@ -215,7 +214,11 @@ class BuyService $v['spec_coding'] = $goods_base['data']['spec_base']['coding']; $v['spec_barcode'] = $goods_base['data']['spec_base']['barcode']; } else { - return $goods_base; + $v['is_invalid'] = 1; + $v['inventory'] = 0; + $v['spec_weight'] = 0; + $v['spec_coding'] = ''; + $v['spec_barcode'] = ''; } // 基础信息 diff --git a/public/static/index/default/js/cart.js b/public/static/index/default/js/cart.js index 4fdcffc44..e01d16dfc 100755 --- a/public/static/index/default/js/cart.js +++ b/public/static/index/default/js/cart.js @@ -111,10 +111,10 @@ $(function() if($(this).find('input').is(':checked')) { $(this).find('span.el-text').text('反选'); - $('.am-table').find('input[type="checkbox"]').uCheck('check'); + $('.am-table').find('input[type="checkbox"]').not(':disabled').uCheck('check'); } else { $(this).find('span.el-text').text('全选'); - $('.am-table').find('input[type="checkbox"]').uCheck('uncheck'); + $('.am-table').find('input[type="checkbox"]').not(':disabled').uCheck('uncheck'); } // 计算选择的商品总数和总价