import
parent
86d6ac65d9
commit
618a3ec593
|
|
@ -49,14 +49,20 @@ class StoreProduct
|
||||||
|
|
||||||
$stock = $cells[++$index];// 库存
|
$stock = $cells[++$index];// 库存
|
||||||
|
|
||||||
$store = Store::where(['title' => $storeName])->firstOrFail();
|
$store = Store::where(['title' => $storeName])->first();
|
||||||
|
if (!$store) {
|
||||||
|
throw new ImportException('门店 '.$storeName.' 不存在');
|
||||||
|
}
|
||||||
|
|
||||||
$goods = [
|
$goods = [
|
||||||
'name' => $goodsName,
|
'name' => $goodsName,
|
||||||
'subtitle' => $goodsTitle,
|
'subtitle' => $goodsTitle,
|
||||||
'shipping_template_id' => 1,
|
'shipping_template_id' => 1,
|
||||||
];
|
];
|
||||||
$category = ProductCategory::where('name', $categoryName)->firstOrFail();
|
$category = ProductCategory::where('name', $categoryName)->first();
|
||||||
|
if (!$category) {
|
||||||
|
throw new ImportException('分类 '.$categoryName.' 不存在');
|
||||||
|
}
|
||||||
$goods['category_id'] = $category->id;
|
$goods['category_id'] = $category->id;
|
||||||
|
|
||||||
// 图片组
|
// 图片组
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue