|
|
|
@ -72,6 +72,7 @@ class SyncCategory extends Command |
|
|
|
|
$upData = [ |
|
|
|
|
'name' => $value['name'], |
|
|
|
|
'level' => $value['level'], |
|
|
|
|
'sort' => $value['sort'], |
|
|
|
|
'parent_id' => $p_category['category_id'] ?? 0, |
|
|
|
|
]; |
|
|
|
|
if ($is_update_image) { |
|
|
|
@ -119,6 +120,7 @@ class SyncCategory extends Command |
|
|
|
|
$upData1 = [ |
|
|
|
|
'name' => $value1['name'], |
|
|
|
|
'level' => $value1['level'], |
|
|
|
|
'sort' => $value1['sort'], |
|
|
|
|
'parent_id' => $p_category1['category_id'] ?? 0, |
|
|
|
|
]; |
|
|
|
|
if ($is_update_image) { |
|
|
|
@ -155,7 +157,6 @@ class SyncCategory extends Command |
|
|
|
|
if ($value2['status'] != 1) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$category2 = CategoryModel::where('original_category_id', $value2['category_id'])->where('store_id', $new_store_id)->find(); |
|
|
|
|
if ($category2) { |
|
|
|
|
//更新分类 |
|
|
|
@ -164,6 +165,7 @@ class SyncCategory extends Command |
|
|
|
|
$upData2 = [ |
|
|
|
|
'name' => $value2['name'], |
|
|
|
|
'level' => $value2['level'], |
|
|
|
|
'sort' => $value2['sort'], |
|
|
|
|
'parent_id' => $p_category2['category_id'] ?? 0, |
|
|
|
|
]; |
|
|
|
|
if ($is_update_image) { |
|
|
|
@ -209,6 +211,7 @@ class SyncCategory extends Command |
|
|
|
|
$upData3 = [ |
|
|
|
|
'name' => $value3['name'], |
|
|
|
|
'level' => $value3['level'], |
|
|
|
|
'sort' => $value3['sort'], |
|
|
|
|
'parent_id' => $p_category3['category_id'] ?? 0, |
|
|
|
|
]; |
|
|
|
|
if ($is_update_image) { |
|
|
|
@ -246,14 +249,15 @@ class SyncCategory extends Command |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$category4 = CategoryModel::where('original_category_id', $value4['category_id'])->find(); |
|
|
|
|
$category4 = CategoryModel::where('original_category_id', $value4['category_id'])->where('store_id', $new_store_id)->find(); |
|
|
|
|
if ($category4) { |
|
|
|
|
//更新分类 |
|
|
|
|
//父类id |
|
|
|
|
$p_category4 = CategoryModel::where('original_category_id', $value4['parent_id'])->find(); |
|
|
|
|
$p_category4 = CategoryModel::where('original_category_id', $value4['parent_id'])->where('store_id', $new_store_id)->find(); |
|
|
|
|
$upData4 = [ |
|
|
|
|
'name' => $value4['name'], |
|
|
|
|
'level' => $value4['level'], |
|
|
|
|
'sort' => $value4['sort'], |
|
|
|
|
'parent_id' => $p_category4['category_id'] ?? 0, |
|
|
|
|
]; |
|
|
|
|
if ($is_update_image) { |
|
|
|
|