作者 刘锟

合并分支 'akun' 到 'master'

Akun



查看合并请求 !1117
@@ -706,19 +706,20 @@ class ProjectUpdate extends Command @@ -706,19 +706,20 @@ class ProjectUpdate extends Command
706 $route = $this->get_url_route($item['url'] ?? ''); 706 $route = $this->get_url_route($item['url'] ?? '');
707 if ($route) { 707 if ($route) {
708 //分类 708 //分类
  709 + $category_custom = $category_model->read(['route' => $custom_info['route']], 'id');
  710 + $category_model_id = $category_custom ? $category_custom['id'] : 0;
  711 +
709 $category_id = ''; 712 $category_id = '';
710 if ($item['category'] ?? []) { 713 if ($item['category'] ?? []) {
711 $category_arr = $category_model->list(['original_id' => ['in', array_column($item['category'], 'id')]]); 714 $category_arr = $category_model->list(['original_id' => ['in', array_column($item['category'], 'id')]]);
712 - $category_id = implode(',', array_column($category_arr, 'id'));  
713 -  
714 - //2293项目特殊处理  
715 - if ($project_id == 2293) {  
716 - $category_id = $category_id . ',3'; 715 + $category_id_arr = array_column($category_arr, 'id');
  716 + if ($category_model_id > 0 && (!in_array($category_model_id, $category_id_arr))) {
  717 + array_push($category_id_arr, $category_model_id);
717 } 718 }
  719 + $category_id = implode(',', $category_id_arr);
718 } else { 720 } else {
719 - $category_custom = $category_model->read(['route' => $custom_info['route']], 'id');  
720 - if ($category_custom) {  
721 - $category_id = $category_custom['id']; 721 + if ($category_model_id > 0) {
  722 + $category_id = $category_model_id;
722 } 723 }
723 } 724 }
724 if ($category_id) { 725 if ($category_id) {