作者 刘锟

update

... ... @@ -706,19 +706,20 @@ class ProjectUpdate extends Command
$route = $this->get_url_route($item['url'] ?? '');
if ($route) {
//分类
$category_custom = $category_model->read(['route' => $custom_info['route']], 'id');
$category_model_id = $category_custom ? $category_custom['id'] : 0;
$category_id = '';
if ($item['category'] ?? []) {
$category_arr = $category_model->list(['original_id' => ['in', array_column($item['category'], 'id')]]);
$category_id = implode(',', array_column($category_arr, 'id'));
//2293项目特殊处理
if ($project_id == 2293) {
$category_id = $category_id . ',3';
$category_id_arr = array_column($category_arr, 'id');
if ($category_model_id > 0 && (!in_array($category_model_id, $category_id_arr))) {
array_push($category_id_arr, $category_model_id);
}
$category_id = implode(',', $category_id_arr);
} else {
$category_custom = $category_model->read(['route' => $custom_info['route']], 'id');
if ($category_custom) {
$category_id = $category_custom['id'];
if ($category_model_id > 0) {
$category_id = $category_model_id;
}
}
if ($category_id) {
... ...