仓库-商品库存同步优化

feat/task1-c-wallet
devil 2020-07-17 00:07:12 +08:00
parent 46b1072d80
commit dd0a77e835
2 changed files with 8 additions and 3 deletions

View File

@ -618,10 +618,10 @@ class GoodsService
sort($group);
}
return [
return [
'title' => $title,
'value' => $group,
];
];
}
/**

View File

@ -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;