|
...
|
...
|
@@ -542,6 +542,20 @@ class ProjectUpdate extends Command |
|
|
|
$data = curl_c($url);
|
|
|
|
if (isset($data['code']) && $data['code'] == 200) {
|
|
|
|
$category = $data['data']['category'] ?? [];
|
|
|
|
if (empty($category)) {
|
|
|
|
$route_model = new RouteMap();
|
|
|
|
$route_page = $route_model->read(['source' => 'page', 'route' => $custom_info['route']], 'id');
|
|
|
|
if (!$route_page) {
|
|
|
|
$category = [
|
|
|
|
[
|
|
|
|
'id' => 0,
|
|
|
|
'name' => $custom_info['route'],
|
|
|
|
'url' => '/' . $custom_info['route'],
|
|
|
|
'parent' => 0
|
|
|
|
]
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->category_custom_insert($project_id, $custom_info['id'], $category, 0);
|
|
|
|
|
|
|
|
$count = $data['data']['count'] ?? 0;
|
|
...
|
...
|
@@ -564,6 +578,11 @@ class ProjectUpdate extends Command |
|
|
|
if ($item['category'] ?? []) {
|
|
|
|
$category_arr = $category_model->list(['original_id' => ['in', array_column($item['category'], 'id')]]);
|
|
|
|
$category_id = implode(',', array_column($category_arr, 'id'));
|
|
|
|
} else {
|
|
|
|
$category_custom = $category_model->read(['route' => $custom_info['route']], 'id');
|
|
|
|
if ($category_custom) {
|
|
|
|
$category_id = $category_custom['id'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//名称去掉特殊符号
|
|
|
|
$item['title'] = $this->special2str($item['title'] ?? '');
|
...
|
...
|
|