From cf3bec796bb24a363a8dc3290a33a55c36222136 Mon Sep 17 00:00:00 2001 From: devil Date: Tue, 31 Dec 2019 16:40:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=94=AF=E4=BB=98=E5=89=8D?= =?UTF-8?q?=E5=85=88=E6=A0=A1=E9=AA=8C=E5=BA=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/service/BuyService.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/application/service/BuyService.php b/application/service/BuyService.php index 8b0d3b5cc..4e3d7c91c 100755 --- a/application/service/BuyService.php +++ b/application/service/BuyService.php @@ -1348,13 +1348,13 @@ class BuyService { foreach($order_detail as $v) { - $goods = Db::name('Goods')->field('is_deduction_inventory,inventory')->find($v['goods_id']); + $goods = Db::name('Goods')->field('is_deduction_inventory,inventory,title')->find($v['goods_id']); if(isset($goods['is_deduction_inventory']) && $goods['is_deduction_inventory'] == 1) { // 先判断商品库存是否不足 if($goods['inventory'] < $v['buy_number']) { - return DataReturn('商品库存不足['.$goods['inventory'].'<'.$v['buy_number'].']', -10); + return DataReturn('库存不足['.$goods['title'].'('.$goods['inventory'].'<'.$v['buy_number'].')]', -10); } // 规格库存 @@ -1366,7 +1366,7 @@ class BuyService $inventory = Db::name('GoodsSpecBase')->where(['id'=>$base['data']['spec_base']['id'], 'goods_id'=>$v['goods_id']])->value('inventory'); if($inventory < $v['buy_number']) { - return DataReturn('商品规格库存不足['.$inventory.'<'.$v['buy_number'].']', -10); + return DataReturn('库存不足['.$goods['title'].'('.$inventory.'<'.$v['buy_number'].')]', -10); } } else { return $base; @@ -1459,13 +1459,13 @@ class BuyService $temp = Db::name('OrderGoodsInventoryLog')->where(['order_id'=>$params['order_id'], 'order_detail_id'=>$v['id'], 'goods_id'=>$v['goods_id']])->find(); if(empty($temp)) { - $goods = Db::name('Goods')->field('is_deduction_inventory,inventory')->find($v['goods_id']); + $goods = Db::name('Goods')->field('is_deduction_inventory,inventory,title')->find($v['goods_id']); if(isset($goods['is_deduction_inventory']) && $goods['is_deduction_inventory'] == 1) { // 先判断商品库存是否不足 if($goods['inventory'] < $v['buy_number']) { - return DataReturn('商品库存不足['.$goods['inventory'].'<'.$v['buy_number'].']', -10); + return DataReturn('商品库存不足['.$goods['title'].'('.$goods['inventory'].'<'.$v['buy_number'].')]', -10); } // 扣除操作 @@ -1483,7 +1483,7 @@ class BuyService $inventory = Db::name('GoodsSpecBase')->where(['id'=>$base['data']['spec_base']['id'], 'goods_id'=>$v['goods_id']])->value('inventory'); if($inventory < $v['buy_number']) { - return DataReturn('商品规格库存不足['.$inventory.'<'.$v['buy_number'].']', -10); + return DataReturn('商品规格库存不足['.$goods['title'].'('.$inventory.'<'.$v['buy_number'].']', -10); } // 扣除规格操作