refactor: 产品导出健壮性修改
This commit is contained in:
@@ -450,7 +450,9 @@ class Product
|
|||||||
if (!$product_related->isEmpty()) {
|
if (!$product_related->isEmpty()) {
|
||||||
$related = [];
|
$related = [];
|
||||||
foreach ($product_related as $item) {
|
foreach ($product_related as $item) {
|
||||||
$related[$item['product_id']][] = $item->product->spu;
|
if (!empty($item->product)) {
|
||||||
|
$related[$item['product_id']][] = $item->product->spu;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$products->each(function($product) use($related) {
|
$products->each(function($product) use($related) {
|
||||||
if (empty($related[$product->id])) {
|
if (empty($related[$product->id])) {
|
||||||
|
|||||||
Reference in New Issue
Block a user