6
0
Fork 0
base
panliang 2023-02-12 09:57:31 +08:00
parent 86d6ac65d9
commit 618a3ec593
1 changed files with 8 additions and 2 deletions

View File

@ -49,14 +49,20 @@ class StoreProduct
$stock = $cells[++$index];// 库存
$store = Store::where(['title' => $storeName])->firstOrFail();
$store = Store::where(['title' => $storeName])->first();
if (!$store) {
throw new ImportException('门店 '.$storeName.' 不存在');
}
$goods = [
'name' => $goodsName,
'subtitle' => $goodsTitle,
'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;
// 图片组