Ai相关调整
This commit is contained in:
@@ -5,6 +5,7 @@ namespace app\api\controller;
|
||||
use app\api\controller\Base;
|
||||
use think\Db;
|
||||
use app\common\OpenAi;
|
||||
use app\common\Article;
|
||||
/**
|
||||
* @title AI审核文章
|
||||
* @description 对接OPENAI接口
|
||||
@@ -53,7 +54,7 @@ class Aireview extends Base
|
||||
}
|
||||
|
||||
//实例化公共方法
|
||||
$oOpenAi = new OpenAi;
|
||||
$oArticle = new Article;
|
||||
if($aArticle['state'] > 4 ){
|
||||
//查询文章内容
|
||||
$aWhere['type'] = 0;
|
||||
@@ -70,7 +71,7 @@ class Aireview extends Base
|
||||
}
|
||||
}else{
|
||||
|
||||
$aFile = json_decode($oOpenAi->getFileContent(['article_id' => $iArticleId]),true);
|
||||
$aFile = json_decode($oArticle->getFileContent(['article_id' => $iArticleId]),true);
|
||||
$aFile = empty($aFile['data']) ? [] : $aFile['data'];
|
||||
$aArticleMain = empty($aFile['mains']) ? [] : $aFile['mains'];
|
||||
}
|
||||
@@ -92,7 +93,7 @@ class Aireview extends Base
|
||||
$aSearch['{journal_name}'] = '传统医学研究';
|
||||
}
|
||||
//查询期刊内容
|
||||
$aJournalPaperArt = json_decode($oOpenAi->getJournalPaperArt($aJournal),true);
|
||||
$aJournalPaperArt = json_decode($oArticle->getJournalPaperArt($aJournal),true);
|
||||
$sJournalContent = empty($aJournalPaperArt['data']) ? '' : implode('', $aJournalPaperArt['data']);
|
||||
$sJournalContent = empty($sJournalContent) ? $aJournal['scope'] : $sJournalContent;
|
||||
$aSearch['{scope}'] = $sJournalContent;//期刊范围
|
||||
@@ -222,12 +223,14 @@ class Aireview extends Base
|
||||
}
|
||||
|
||||
//查询文章
|
||||
$aArticle = Db::table('t_article')->field('article_id,abstrart,keywords,journal_id,title,state')->where('article_id',$aParam['article_id'])->find();
|
||||
$aArticle = Db::name('article')->field('article_id,abstrart,keywords,journal_id,title,state')->where('article_id',$aParam['article_id'])->find();
|
||||
if(empty($aArticle)){
|
||||
return json_encode(array('status' => 3,'msg' => 'No articles requiring review were found' ));
|
||||
}
|
||||
//查询文章审核内容
|
||||
$aAiReview = Db::table('t_article_ai_review')->where('article_id',$aParam['article_id'])->find();
|
||||
return json_encode(array('status' => 1,'msg' => 'Successfully obtained article review content','data' => $aAiReview,'article_data' => $aArticle));
|
||||
$oAireview = new \app\common\Aireview;
|
||||
$aAireview = $oAireview->get($aParam);
|
||||
$aAireview = empty($aAireview['data']) ? [] : $aAireview['data'];
|
||||
return json_encode(array('status' => 1,'msg' => 'Successfully obtained article review content','data' => $aAireview,'article_data' => $aArticle));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user