作者 lyh

gx生成评论

@@ -55,10 +55,10 @@ class InitKeywordCommon extends Command @@ -55,10 +55,10 @@ class InitKeywordCommon extends Command
55 $text = Gpt::instance()->openai_chat_qqs($info['ai']); 55 $text = Gpt::instance()->openai_chat_qqs($info['ai']);
56 $text = Common::deal_keywords($text); 56 $text = Common::deal_keywords($text);
57 $text = Common::deal_str($text); 57 $text = Common::deal_str($text);
58 - $text = preg_match_all('/\{[^{}]*\}/', $text, $matches); 58 + preg_match_all('/\{[^{}]*\}/', $text, $matches);
59 if(!empty($text)){ 59 if(!empty($text)){
60 $data = []; 60 $data = [];
61 - foreach ($text as $item){ 61 + foreach ($matches[0] as $item){
62 $data[] = [ 62 $data[] = [
63 'nickname'=>$item['name'], 63 'nickname'=>$item['name'],
64 'text'=>$item['comment'], 64 'text'=>$item['comment'],