This commit is contained in:
wangjinlei
2023-05-06 18:23:28 +08:00
parent 152a6be6b8
commit d9658b40d6
2 changed files with 34 additions and 7 deletions

View File

@@ -120,10 +120,10 @@ class Production extends Base
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$p_info = $this->production_article_obj->where('p_article_id',$data['p_article_id'])->find();
$mains = $this->production_article_main_obj->where('p_article_id',$data['p_article_id'])->where('state',0)->select();
$re['mains'] = $mains;
$re['production'] = $p_info;
return jsonSuccess($re);
}
@@ -163,6 +163,28 @@ class Production extends Base
return jsonSuccess([]);
}
/**main内容gpt程序校对
* @return void
*
*/
public function mainGptcheck(){
$data = $this->request->post();
$rule = new Validate([
'p_main_id'=>'require'
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$main_info = $this->production_article_main_obj->where('p_main_id',$data['p_main_id'])->find();
if(mb_strlen($main_info['content'])<20){
return trim($main_info['content']);
}
$res = object_to_array(json_decode(pushGpt('请将以下内容按照医学期刊的标准校对,不要改变原意,主要是对格式和拼写的校对,将<b></b><i></i>这四个标签保留,将校对好的内容返回 '.trim($main_info['content']))));
$r = $res['choices'][0]['message']['content'];
$re['content'] = $r;
return jsonSuccess($re);
}
/**
* 删除生产实例
*/