作者 lyh

gx生成评论

<?php
/**
* @remark :
* @name :InitKeywordCommon.php
* @name :InitKeywordComment.php
* @author :lyh
* @method :post
* @time :2025/6/3 15:38
... ... @@ -13,10 +13,10 @@ use App\Helper\Common;
use App\Helper\Gpt;
use App\Models\Ai\AiCommand;
use App\Models\Com\NoticeLog;
use App\Models\Project\AggregateKeywordCommon;
use App\Models\Project\AggregateKeywordComment;
use Illuminate\Console\Command;
class InitKeywordCommon extends Command
class InitKeywordComment extends Command
{
/**
* The name and signature of the console command.
... ... @@ -53,8 +53,6 @@ class InitKeywordCommon extends Command
$aiCommonModel = new AiCommand();
$info = $aiCommonModel->read(['key'=>'tag_comment']);
$text = Gpt::instance()->openai_chat_qqs($info['ai']);
$text = Common::deal_keywords($text);
$text = Common::deal_str($text);
dd($text);
preg_match_all('/\{[^{}]*\}/', $text, $matches);
if(!empty($text)){
... ... @@ -68,7 +66,7 @@ class InitKeywordCommon extends Command
'uid'=>0,
];
}
$keywordCommonModel = new AggregateKeywordCommon();
$keywordCommonModel = new AggregateKeywordComment();
$keywordCommonModel->insertAll($data);
}
return true;
... ...
<?php
/**
* @remark :
* @name :AggregateKeywordCommon.php
* @name :AggregateKeywordComment.php
* @author :lyh
* @method :post
* @time :2025/6/3 17:42
... ... @@ -11,7 +11,7 @@ namespace App\Models\Project;
use App\Models\Base;
class AggregateKeywordCommon extends Base
class AggregateKeywordComment extends Base
{
protected $table = 'gl_aggregate_keyword_common';
protected $table = 'gl_aggregate_keyword_comment';
}
... ...