AI相关调整
This commit is contained in:
@@ -21,30 +21,22 @@ class Aireview
|
||||
if(empty($iJournalId)){
|
||||
return ['status' => 2,'msg' => 'The journal to which the article belongs cannot be empty'];
|
||||
}
|
||||
|
||||
$oArticle = new \app\common\Article;
|
||||
//返回数组
|
||||
$aResult = ['status' => 1,'msg' => 'AI review successful'];
|
||||
//数据库参数
|
||||
$aFields = ['journal_scope','attribute','contradiction','unreasonable','ethics','academic','conclusion','fund_number','hotspot','submit_direction','references_past_three','references_past_five','references_ratio_JCR1','references_ratio_JCR2','registration_assessment','cite_rate','references_num','article_field'];
|
||||
$aFields = ['journal_scope_assessment','journal_scope_explanation','other_journal_assessment','other_journal_issn','other_journal_explanation','attribute_assessment','attribute_explanation','contradiction_assessment','contradiction_explanation','unreasonable_assessment','unreasonable_explanation','ethics_assessment','ethics_explanation','academic_assessment','academic_explanation','conclusion_assessment','conclusion_explanation','fund_number','hotspot','submit_direction','references_past_three','references_num','references_past_five','references_ratio_JCR1','references_ratio_JCR2','registration_assessment','registration_explanation','cite_rate','article_field_assessment','article_field_explanation','is_finish','article_id','journal_id'];
|
||||
$oHelperFunction = new \app\common\HelperFunction;
|
||||
foreach ($aParam as $key => $value) {
|
||||
if(empty($value)){
|
||||
continue;
|
||||
}
|
||||
if(is_array($value)){
|
||||
if(!empty($value['assessment'])){
|
||||
$sField = $key.'_'.'assessment';
|
||||
$sAssessment = empty($value['assessment']) ? '' : $value['assessment'];
|
||||
if(!empty($sAssessment)){
|
||||
$sAssessment = is_array($sAssessment) ? json_encode($sAssessment) : htmlspecialchars($value['assessment']);
|
||||
}
|
||||
$aInsert[$sField] = $sAssessment;
|
||||
}
|
||||
if(!empty($value['explanation'])){
|
||||
$sField = $key.'_'.'explanation';
|
||||
$aInsert[$sField] = empty($value['explanation']) ? '' : htmlspecialchars($value['explanation']);
|
||||
}
|
||||
}else{
|
||||
$aInsert[$key] = empty($value) ? '' : htmlspecialchars($value);
|
||||
if(!in_array($key, $aFields)){
|
||||
continue;
|
||||
}
|
||||
$value = is_array($value) ? json_encode($value) : $value;
|
||||
$aInsert[$key] = $oHelperFunction->func_safe($value);
|
||||
}
|
||||
if(empty($aInsert)){
|
||||
return ['status' => 3,'msg' => 'Data is empty'];
|
||||
@@ -71,8 +63,7 @@ class Aireview
|
||||
if(!Db::name('article_ai_review')->where($aWhere)->limit(1)->update($aInsert)){
|
||||
$aResult = ['status' => 5,'msg' => 'Failed to add AI audit content'];
|
||||
}
|
||||
$aAiReview = Db::table('t_article_ai_review')->where($aWhere)->find();
|
||||
$aResult['data'] = $aAiReview;
|
||||
$aResult['data'] = $aInsert;
|
||||
return $aResult;
|
||||
}
|
||||
return ['status' => 6,'msg' => 'illegal request'];
|
||||
|
||||
Reference in New Issue
Block a user