提交 dd0a77e8 编写于 作者: D devil

仓库-商品库存同步优化

上级 46b1072d
...@@ -618,10 +618,10 @@ class GoodsService ...@@ -618,10 +618,10 @@ class GoodsService
sort($group); sort($group);
} }
return [ return [
'title' => $title, 'title' => $title,
'value' => $group, 'value' => $group,
]; ];
} }
/** /**
......
...@@ -523,6 +523,7 @@ class WarehouseGoodsService ...@@ -523,6 +523,7 @@ class WarehouseGoodsService
]; ];
} }
} else { } else {
// 没有规格则处理默认规格 default
$str = 'default'; $str = 'default';
$inventory_spec[] = [ $inventory_spec[] = [
'name' => '默认规格', 'name' => '默认规格',
...@@ -736,7 +737,11 @@ class WarehouseGoodsService ...@@ -736,7 +737,11 @@ class WarehouseGoodsService
$res = GoodsService::GoodsSpecificationsActual($goods_id); $res = GoodsService::GoodsSpecificationsActual($goods_id);
if(empty($res['value'])) 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; $inventory_total = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册