1
This commit is contained in:
@@ -1329,6 +1329,21 @@ class Article extends Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getArticleReportAuthors(){
|
||||||
|
$num = $this->request->post('num');
|
||||||
|
// $num = 1;
|
||||||
|
$size = 500;
|
||||||
|
$f = ($num-1)*$size;
|
||||||
|
$list = $this->article_obj->where('state',0)->limit($f,$size)->select();
|
||||||
|
foreach($list as $k => $v){
|
||||||
|
$author = $this->article_author_obj->where('article_id',$v['article_id'])->where('is_report',1)->where('state',0)->select();
|
||||||
|
$list[$k]['author'] = $author;
|
||||||
|
}
|
||||||
|
$re['list'] = $list;
|
||||||
|
return jsonSuccess($re);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 文章文件上传
|
* @title 文章文件上传
|
||||||
* @description 文章文件上传
|
* @description 文章文件上传
|
||||||
@@ -1629,52 +1644,52 @@ class Article extends Controller {
|
|||||||
// die;
|
// die;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function cccc(){
|
// public function cccc(){
|
||||||
die;
|
// die;
|
||||||
$data = $this->request->post();
|
// $data = $this->request->post();
|
||||||
$rule = new Validate([
|
// $rule = new Validate([
|
||||||
'num'=>'require'
|
// 'num'=>'require'
|
||||||
]);
|
// ]);
|
||||||
if(!$rule->check($data)){
|
// if(!$rule->check($data)){
|
||||||
return jsonError($rule->getError());
|
// return jsonError($rule->getError());
|
||||||
}
|
// }
|
||||||
|
|
||||||
$limit_start = ($data['num'] - 1) * 20;
|
// $limit_start = ($data['num'] - 1) * 20;
|
||||||
$list = $this->article_obj->where('doi','like',"10.12032%")->where('state',0)->limit($limit_start,20)->select();
|
// $list = $this->article_obj->where('doi','like',"10.12032%")->where('state',0)->limit($limit_start,20)->select();
|
||||||
foreach($list as $v){
|
// foreach($list as $v){
|
||||||
$c = explode('/',$v['doi']);
|
// $c = explode('/',$v['doi']);
|
||||||
|
|
||||||
|
|
||||||
$author = $this->article_author_obj->where('article_id', $v['article_id'])->where('state', 0)->find();
|
// $author = $this->article_author_obj->where('article_id', $v['article_id'])->where('state', 0)->find();
|
||||||
if ($author == null) {
|
// if ($author == null) {
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
$article_info = $this->article_obj->where('article_id', $v['article_id'])->find();
|
// $article_info = $this->article_obj->where('article_id', $v['article_id'])->find();
|
||||||
if ($article_info['npp'] == '') {
|
// if ($article_info['npp'] == '') {
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
$url = 'https://doi.crossref.org/servlet/deposit';
|
// $url = 'https://doi.crossref.org/servlet/deposit';
|
||||||
$file = ROOT_PATH . 'public' . DS . 'xml' . DS . $v['article_id'] . '.xml';
|
// $file = ROOT_PATH . 'public' . DS . 'xml' . DS . $v['article_id'] . '.xml';
|
||||||
|
|
||||||
$d['article_id'] = $v['article_id'];
|
// $d['article_id'] = $v['article_id'];
|
||||||
$d['doi_num'] = $c[1];
|
// $d['doi_num'] = $c[1];
|
||||||
$this->crossRef($d);
|
// $this->crossRef($d);
|
||||||
|
|
||||||
//存储
|
// //存储
|
||||||
$this->article_obj->where('article_id', $v['article_id'])->update(['doi' => '10.53388/' . $c[1]]);
|
// $this->article_obj->where('article_id', $v['article_id'])->update(['doi' => '10.53388/' . $c[1]]);
|
||||||
|
|
||||||
//发送请求
|
// //发送请求
|
||||||
$par['login_id'] = 'books@tmrjournals.com/tmrp';
|
// $par['login_id'] = 'books@tmrjournals.com/tmrp';
|
||||||
$par['login_passwd'] = '849192806pnX';
|
// $par['login_passwd'] = '849192806pnX';
|
||||||
$par['fname'] = new \CURLFile($file);
|
// $par['fname'] = new \CURLFile($file);
|
||||||
|
|
||||||
$this->myPost($url, $par);
|
// $this->myPost($url, $par);
|
||||||
// echo '10.53388/'.$c[1];
|
// // echo '10.53388/'.$c[1];
|
||||||
// echo '<br/>';
|
// // echo '<br/>';
|
||||||
}
|
// }
|
||||||
|
|
||||||
// dump($list);
|
// // dump($list);
|
||||||
}
|
// }
|
||||||
|
|
||||||
public function crossRef($data) {
|
public function crossRef($data) {
|
||||||
$xml = '';
|
$xml = '';
|
||||||
@@ -1743,6 +1758,11 @@ http://www.crossref.org/schemas/crossref4.3.7.xsd">' . PHP_EOL . PHP_EOL;
|
|||||||
$xml .= '<doi_data>' . PHP_EOL;
|
$xml .= '<doi_data>' . PHP_EOL;
|
||||||
$xml .= '<doi>10.53388/' . trim($data['doi_num']) . '</doi>' . PHP_EOL;
|
$xml .= '<doi>10.53388/' . trim($data['doi_num']) . '</doi>' . PHP_EOL;
|
||||||
$xml .= '<resource><![CDATA[https://www.tmrjournals.com/article.html?J_num=' . $journal_info['journal_id'] . '&a_id=' . $article_info['article_id'] . ']]></resource>' . PHP_EOL;
|
$xml .= '<resource><![CDATA[https://www.tmrjournals.com/article.html?J_num=' . $journal_info['journal_id'] . '&a_id=' . $article_info['article_id'] . ']]></resource>' . PHP_EOL;
|
||||||
|
$xml .= '<collection property="crawler-based">'.PHP_EOL;
|
||||||
|
$xml .= '<item crawler="iParadigms">'.PHP_EOL;
|
||||||
|
$xml .= '<resource><![CDATA[https://www.tmrjournals.com/public/articlePDF/' . $article_info['file_pdf'] . ']]></resource>'.PHP_EOL;
|
||||||
|
$xml .= '</item>'.PHP_EOL;
|
||||||
|
$xml .= '</collection>'.PHP_EOL;
|
||||||
$xml .= '</doi_data>' . PHP_EOL;
|
$xml .= '</doi_data>' . PHP_EOL;
|
||||||
$xml .= '</journal_article>' . PHP_EOL;
|
$xml .= '</journal_article>' . PHP_EOL;
|
||||||
$xml .= '</journal>' . PHP_EOL;
|
$xml .= '</journal>' . PHP_EOL;
|
||||||
|
|||||||
Reference in New Issue
Block a user