作者 刘锟

update

@@ -237,6 +237,7 @@ class ProjectUpdate extends Command @@ -237,6 +237,7 @@ class ProjectUpdate extends Command
237 $items = $data_page['data']['data'] ?? []; 237 $items = $data_page['data']['data'] ?? [];
238 238
239 $model = new Product(); 239 $model = new Product();
  240 + $category_model = new Category();
240 $logic = new CategoryLogic(); 241 $logic = new CategoryLogic();
241 242
242 foreach ($items as $item) { 243 foreach ($items as $item) {
@@ -273,7 +274,7 @@ class ProjectUpdate extends Command @@ -273,7 +274,7 @@ class ProjectUpdate extends Command
273 } 274 }
274 275
275 if ($new_category) { 276 if ($new_category) {
276 - $category_arr = $model->list(['original_id' => ['in', $new_category]]); 277 + $category_arr = $category_model->list(['original_id' => ['in', $new_category]]);
277 $category_id = $logic->getLastCategory(array_column($category_arr, 'id')); 278 $category_id = $logic->getLastCategory(array_column($category_arr, 'id'));
278 } 279 }
279 280
@@ -340,7 +341,7 @@ class ProjectUpdate extends Command @@ -340,7 +341,7 @@ class ProjectUpdate extends Command
340 } 341 }
341 342
342 if ($new_category) { 343 if ($new_category) {
343 - $category_arr = $model->list(['original_id' => ['in', $new_category]]); 344 + $category_arr = $category_model->list(['original_id' => ['in', $new_category]]);
344 $category_id = $logic->getLastCategory(array_column($category_arr, 'id')); 345 $category_id = $logic->getLastCategory(array_column($category_arr, 'id'));
345 } 346 }
346 } 347 }