作者 赵彬吉

update

@@ -98,9 +98,10 @@ class KeywordPageAiContent extends Command @@ -98,9 +98,10 @@ class KeywordPageAiContent extends Command
98 public function ai_content(ProjectKeywordAiTask $task) 98 public function ai_content(ProjectKeywordAiTask $task)
99 { 99 {
100 //前后缀 100 //前后缀
  101 + $default_affix = AggregateKeywordAffix::where('project_id', 0)->first();
101 $affix = AggregateKeywordAffix::where('project_id', $task->project_id)->first(); 102 $affix = AggregateKeywordAffix::where('project_id', $task->project_id)->first();
102 - $prefix = empty($affix['prefix']) ? [] : explode("\r\n", $affix['prefix']);  
103 - $suffix = empty($affix['suffix']) ? [] : explode("\r\n", $affix['suffix']); 103 + $prefix = empty($affix['prefix']) ? explode("\r\n", $default_affix['prefix']) : explode("\r\n", $affix['prefix']);
  104 + $suffix = empty($affix['suffix']) ? explode("\r\n", $default_affix['suffix']) : explode("\r\n", $affix['suffix']);
104 if (!$prefix || !$suffix) { 105 if (!$prefix || !$suffix) {
105 throw new ValidateException('扩展标题前后缀不存在'); 106 throw new ValidateException('扩展标题前后缀不存在');
106 } 107 }