From dd0a77e8355ff437da6972c3340e3b90c42b8c28 Mon Sep 17 00:00:00 2001 From: devil Date: Fri, 17 Jul 2020 00:07:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=93=E5=BA=93-=E5=95=86=E5=93=81=E5=BA=93?= =?UTF-8?q?=E5=AD=98=E5=90=8C=E6=AD=A5=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/service/GoodsService.php | 4 ++-- application/service/WarehouseGoodsService.php | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/application/service/GoodsService.php b/application/service/GoodsService.php index 97b77f619..9ee5c1420 100755 --- a/application/service/GoodsService.php +++ b/application/service/GoodsService.php @@ -618,10 +618,10 @@ class GoodsService sort($group); } - return [ + return [ 'title' => $title, 'value' => $group, - ]; + ]; } /** diff --git a/application/service/WarehouseGoodsService.php b/application/service/WarehouseGoodsService.php index 3e26210f1..cd947bb2b 100644 --- a/application/service/WarehouseGoodsService.php +++ b/application/service/WarehouseGoodsService.php @@ -523,6 +523,7 @@ class WarehouseGoodsService ]; } } else { + // 没有规格则处理默认规格 default $str = 'default'; $inventory_spec[] = [ 'name' => '默认规格', @@ -736,7 +737,11 @@ class WarehouseGoodsService $res = GoodsService::GoodsSpecificationsActual($goods_id); if(empty($res['value'])) { - $res['value'][] = 'default'; + // 没有规格则读取默认规格数据 + $res['value'][] = [ + 'base_id' => Db::name('GoodsSpecBase')->where(['goods_id'=>$goods_id])->value('id'), + 'value' => 'default', + ]; } $inventory_total = 0;