参考文献列表接口调整

This commit is contained in:
chengxl
2025-11-27 09:54:09 +08:00
parent 7009332c9f
commit 42c6c887ad

View File

@@ -592,14 +592,17 @@ class Production extends Base
$this->refuseReferIndex($data['p_article_id']);
$dois = $this->production_article_refer_obj->where("p_article_id", $data['p_article_id'])->where("refer_doi","<>","")->where("state",0)->group("refer_doi")->having("count(*)>1")->column("refer_doi");
$list = $this->production_article_refer_obj->where('p_article_id', $data['p_article_id'])->where('state', 0)->order("index")->select();
$aRepeat = [];
foreach ($list as $k => $v){
if(in_array($v['refer_doi'],$dois)){
$list[$k]['is_repeat'] = 1;
$aRepeat[$v['refer_doi']][] = $v['index'];
}else{
$list[$k]['is_repeat'] = 0;
}
}
$re['refers'] = $list;
$re['repeat'] = empty($aRepeat) ? [] : $aRepeat;
return jsonSuccess($re);
}