|
1
|
<?php
|
1
|
<?php
|
|
2
|
/**
|
2
|
/**
|
|
3
|
* @remark :
|
3
|
* @remark :
|
|
4
|
- * @name :InitKeywordCommon.php
|
4
|
+ * @name :InitKeywordComment.php
|
|
5
|
* @author :lyh
|
5
|
* @author :lyh
|
|
6
|
* @method :post
|
6
|
* @method :post
|
|
7
|
* @time :2025/6/3 15:38
|
7
|
* @time :2025/6/3 15:38
|
|
@@ -13,10 +13,10 @@ use App\Helper\Common; |
|
@@ -13,10 +13,10 @@ use App\Helper\Common; |
|
13
|
use App\Helper\Gpt;
|
13
|
use App\Helper\Gpt;
|
|
14
|
use App\Models\Ai\AiCommand;
|
14
|
use App\Models\Ai\AiCommand;
|
|
15
|
use App\Models\Com\NoticeLog;
|
15
|
use App\Models\Com\NoticeLog;
|
|
16
|
-use App\Models\Project\AggregateKeywordCommon;
|
16
|
+use App\Models\Project\AggregateKeywordComment;
|
|
17
|
use Illuminate\Console\Command;
|
17
|
use Illuminate\Console\Command;
|
|
18
|
|
18
|
|
|
19
|
-class InitKeywordCommon extends Command
|
19
|
+class InitKeywordComment extends Command
|
|
20
|
{
|
20
|
{
|
|
21
|
/**
|
21
|
/**
|
|
22
|
* The name and signature of the console command.
|
22
|
* The name and signature of the console command.
|
|
@@ -53,8 +53,6 @@ class InitKeywordCommon extends Command |
|
@@ -53,8 +53,6 @@ class InitKeywordCommon extends Command |
|
53
|
$aiCommonModel = new AiCommand();
|
53
|
$aiCommonModel = new AiCommand();
|
|
54
|
$info = $aiCommonModel->read(['key'=>'tag_comment']);
|
54
|
$info = $aiCommonModel->read(['key'=>'tag_comment']);
|
|
55
|
$text = Gpt::instance()->openai_chat_qqs($info['ai']);
|
55
|
$text = Gpt::instance()->openai_chat_qqs($info['ai']);
|
|
56
|
- $text = Common::deal_keywords($text);
|
|
|
|
57
|
- $text = Common::deal_str($text);
|
|
|
|
58
|
dd($text);
|
56
|
dd($text);
|
|
59
|
preg_match_all('/\{[^{}]*\}/', $text, $matches);
|
57
|
preg_match_all('/\{[^{}]*\}/', $text, $matches);
|
|
60
|
if(!empty($text)){
|
58
|
if(!empty($text)){
|
|
@@ -68,7 +66,7 @@ class InitKeywordCommon extends Command |
|
@@ -68,7 +66,7 @@ class InitKeywordCommon extends Command |
|
68
|
'uid'=>0,
|
66
|
'uid'=>0,
|
|
69
|
];
|
67
|
];
|
|
70
|
}
|
68
|
}
|
|
71
|
- $keywordCommonModel = new AggregateKeywordCommon();
|
69
|
+ $keywordCommonModel = new AggregateKeywordComment();
|
|
72
|
$keywordCommonModel->insertAll($data);
|
70
|
$keywordCommonModel->insertAll($data);
|
|
73
|
}
|
71
|
}
|
|
74
|
return true;
|
72
|
return true;
|