作者 刘锟

update

... ... @@ -956,10 +956,10 @@ class ProjectUpdate extends Command
foreach ($items as $item) {
$route = $this->get_url_route($item['url'] ?? '');
if ($route) {
$cate = $model->read(['route' => $route], 'id');
if (!$cate) {
try {
$item['name'] = $this->special2str($item['name'] ?? '');
$item['name'] = $this->special2str($item['name'] ?? '');
try {
$cate = $model->read(['route' => $route], 'id');
if (!$cate) {
$cate_id = $model->addReturnId([
'project_id' => $project_id,
'module_id' => $module_id,
... ... @@ -968,10 +968,15 @@ class ProjectUpdate extends Command
'route' => $route
]);
$this->set_map($route, RouteMap::SOURCE_MODULE_CATE, $cate_id, $project_id);
} catch (\Exception $e) {
echo 'date:' . date('Y-m-d H:i:s') . ', category_custom_insert error: ' . $e->getMessage() . PHP_EOL;
continue;
} else {
$model->edit([
'name' => $item['name'],
'original_id' => $item['id'],
], ['id' => $cate['id']]);
}
} catch (\Exception $e) {
echo 'date:' . date('Y-m-d H:i:s') . ', category_custom_insert error: ' . $e->getMessage() . PHP_EOL;
continue;
}
}
}
... ...