This commit is contained in:
wangjinlei
2022-08-08 17:10:48 +08:00
parent 32079bbf37
commit c3b93c9d65
2 changed files with 82 additions and 26 deletions

View File

@@ -241,8 +241,16 @@ function my_doiToFrag($data){
$url = "https://citation.crosscite.org/format?doi=$doi&style=american-veterinary-medical-association&lang=en-US";
$res = myGet($url);
$frag = trim(substr($res,strpos($res,'.')+1));
$frag1 = $frag==""?"none":$frag;
$ts_refer_obj->where('ts_refer_id',$data['ts_refer_id'])->update(['refer_frag'=>$frag1]);
$f = '';
$cs = 0;
if($frag==""){
$f = $data['refer_content'];
}else{
$c_frag = rtrim($frag,'.');
$f = substr_replace($c_frag,PHP_EOL,strripos($c_frag,"http"),0);
$cs = 1;
}
$ts_refer_obj->where('ts_refer_id',$data['ts_refer_id'])->update(['refer_frag'=>$f,"cs"=>$cs]);
}