20201112
This commit is contained in:
@@ -160,6 +160,9 @@ class Article extends Controller {
|
|||||||
//组合cite信息
|
//组合cite信息
|
||||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||||
|
$cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
|
||||||
|
|
||||||
|
$list[$k]['topic'] = $cache_topic;
|
||||||
$list[$k]['cite'] = $cite;
|
$list[$k]['cite'] = $cite;
|
||||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||||
}
|
}
|
||||||
@@ -227,6 +230,9 @@ class Article extends Controller {
|
|||||||
//组合cite信息
|
//组合cite信息
|
||||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||||
|
$cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
|
||||||
|
|
||||||
|
$list[$k]['topic'] = $cache_topic;
|
||||||
$list[$k]['cite'] = $cite;
|
$list[$k]['cite'] = $cite;
|
||||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||||
}
|
}
|
||||||
@@ -258,6 +264,7 @@ class Article extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function addArticleNum(){
|
public function addArticleNum(){
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
|
|
||||||
$this->article_obj->where('article_id',$data['article_id'])->setInc($data['type'].'_num');
|
$this->article_obj->where('article_id',$data['article_id'])->setInc($data['type'].'_num');
|
||||||
$article_info = $this->article_obj->where('article_id',$data['article_id'])->find();
|
$article_info = $this->article_obj->where('article_id',$data['article_id'])->find();
|
||||||
|
|
||||||
@@ -330,6 +337,9 @@ class Article extends Controller {
|
|||||||
//组合cite信息
|
//组合cite信息
|
||||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||||
|
$cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
|
||||||
|
|
||||||
|
$list[$k]['topic'] = $cache_topic;
|
||||||
$list[$k]['cite'] = $cite;
|
$list[$k]['cite'] = $cite;
|
||||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -233,6 +233,9 @@ class Journal extends Controller {
|
|||||||
//组合cite信息
|
//组合cite信息
|
||||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||||
|
$cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
|
||||||
|
|
||||||
|
$list[$k]['topic'] = $cache_topic;
|
||||||
$list[$k]['cite'] = $cite;
|
$list[$k]['cite'] = $cite;
|
||||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||||
}
|
}
|
||||||
@@ -287,8 +290,9 @@ class Journal extends Controller {
|
|||||||
} else {
|
} else {
|
||||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||||
}
|
}
|
||||||
|
$cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
|
||||||
|
|
||||||
// $cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
$list[$k]['topic'] = $cache_topic;
|
||||||
$list[$k]['cite'] = $cite;
|
$list[$k]['cite'] = $cite;
|
||||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||||
}
|
}
|
||||||
@@ -355,6 +359,9 @@ class Journal extends Controller {
|
|||||||
//组合cite信息
|
//组合cite信息
|
||||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||||
|
$cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
|
||||||
|
|
||||||
|
$list[$k]['topic'] = $cache_topic;
|
||||||
$list[$k]['cite'] = $cite;
|
$list[$k]['cite'] = $cite;
|
||||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||||
}
|
}
|
||||||
@@ -392,6 +399,9 @@ class Journal extends Controller {
|
|||||||
//组合cite信息
|
//组合cite信息
|
||||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||||
|
$cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
|
||||||
|
|
||||||
|
$list[$k]['topic'] = $cache_topic;
|
||||||
$list[$k]['cite'] = $cite;
|
$list[$k]['cite'] = $cite;
|
||||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||||
}
|
}
|
||||||
@@ -448,6 +458,9 @@ class Journal extends Controller {
|
|||||||
//组合cite信息
|
//组合cite信息
|
||||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||||
|
$cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
|
||||||
|
|
||||||
|
$list[$k]['topic'] = $cache_topic;
|
||||||
$list[$k]['cite'] = $cite;
|
$list[$k]['cite'] = $cite;
|
||||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||||
}
|
}
|
||||||
@@ -531,6 +544,9 @@ class Journal extends Controller {
|
|||||||
//组合cite信息
|
//组合cite信息
|
||||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||||
|
$cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
|
||||||
|
|
||||||
|
$list[$k]['topic'] = $cache_topic;
|
||||||
$list[$k]['cite'] = $cite;
|
$list[$k]['cite'] = $cite;
|
||||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||||
}
|
}
|
||||||
@@ -703,7 +719,7 @@ class Journal extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function getTopicForSubscribe() {
|
public function getTopicForSubscribe() {
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
$list = $this->journal_topic_obj->where('journal_id', $data['journal_id'])->where('state', 0)->where('level', 2)->select();
|
$list = $this->journal_topic_obj->where('journal_id', $data['journal_id'])->where('state', 0)->where('is_final', 1)->select();
|
||||||
|
|
||||||
$re['topics'] = $list;
|
$re['topics'] = $list;
|
||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
@@ -751,6 +767,57 @@ class Journal extends Controller {
|
|||||||
return jsonSuccess([]);
|
return jsonSuccess([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 添加期刊话题订阅(批量)
|
||||||
|
* @description 添加期刊话题订阅(批量)
|
||||||
|
* @author wangjinlei
|
||||||
|
* @url /api/Journal/addSubscribeTopics
|
||||||
|
* @method POST
|
||||||
|
*
|
||||||
|
* @param name:topic_ids type:string require:1 desc:期刊话题id(1,2,3,4)
|
||||||
|
* @param name:email type:string require:1 desc:邮箱地址
|
||||||
|
*/
|
||||||
|
public function addSubscribeTopics() {
|
||||||
|
$data = $this->request->post();
|
||||||
|
// $topics = explode(',', $data['topic_ids']);
|
||||||
|
$topics = $data['topic_ids'];
|
||||||
|
$str = '';
|
||||||
|
foreach ($topics as $k => $v) {
|
||||||
|
//去重
|
||||||
|
$repeat = $this->subscribe_topic_obj
|
||||||
|
->where('topic_id', $v)
|
||||||
|
->where('email', $data['email'])
|
||||||
|
->where('state', 0)
|
||||||
|
->find();
|
||||||
|
if ($repeat) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$insert['topic_id'] = $v;
|
||||||
|
$insert['email'] = $data['email'];
|
||||||
|
$id = $this->subscribe_topic_obj->insertGetId($insert);
|
||||||
|
$cache_info = $this->journal_topic_obj->where('journal_topic_id',$v)->find();
|
||||||
|
$str .= '<a href="http://journalapi.tmrjournals.com/public/index.php/api/Journal/UnsubscribeTopic/snum/' . $id . '">Unsubscribe topic->'.$cache_info['title'].'</a><br>';
|
||||||
|
}
|
||||||
|
if($str==''){
|
||||||
|
return jsonError('repeat subscribe!');
|
||||||
|
}
|
||||||
|
//发送邮件感谢
|
||||||
|
$tt = 'Dear Researcher,<br><br>';
|
||||||
|
$tt .= 'Welcome you to the email alert for the latest research and more. Thank you for your interest in our publications and topics.<br>';
|
||||||
|
$tt .= $str;
|
||||||
|
$tt .= 'This service is provided by TMR Publishing Group | New Zealand<br>';
|
||||||
|
$tt .= 'Telephone: +64 02108293806';
|
||||||
|
$tt .= 'Email: publisher@tmrjournals.com';
|
||||||
|
$tt .= 'www.tmrjournals.com';
|
||||||
|
$maidata['email'] = $data['email'];
|
||||||
|
$maidata['title'] = 'Thank you for subscribing.';
|
||||||
|
$maidata['content'] = $tt;
|
||||||
|
$maidata['tmail'] = 'publicrelations@tmrjournals.com';
|
||||||
|
$maidata['tpassword'] = 'pRWU999999';
|
||||||
|
Queue::push('app\api\job\mail@fire', $maidata, "mail");
|
||||||
|
return jsonSuccess([]);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 添加期刊话题订阅
|
* @title 添加期刊话题订阅
|
||||||
* @description 添加期刊话题订阅
|
* @description 添加期刊话题订阅
|
||||||
@@ -863,6 +930,9 @@ class Journal extends Controller {
|
|||||||
//组合cite信息
|
//组合cite信息
|
||||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||||
|
$cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
|
||||||
|
|
||||||
|
$list[$k]['topic'] = $cache_topic;
|
||||||
$list[$k]['cite'] = $cite;
|
$list[$k]['cite'] = $cite;
|
||||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||||
|
|
||||||
@@ -922,6 +992,9 @@ class Journal extends Controller {
|
|||||||
//组合cite信息
|
//组合cite信息
|
||||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||||
|
$cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
|
||||||
|
|
||||||
|
$list[$k]['topic'] = $cache_topic;
|
||||||
$list[$k]['cite'] = $cite;
|
$list[$k]['cite'] = $cite;
|
||||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||||
//斜体变红
|
//斜体变红
|
||||||
@@ -1124,6 +1197,9 @@ class Journal extends Controller {
|
|||||||
//组合cite信息
|
//组合cite信息
|
||||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||||
|
$cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
|
||||||
|
|
||||||
|
$list[$k]['topic'] = $cache_topic;
|
||||||
$list[$k]['cite'] = $cite;
|
$list[$k]['cite'] = $cite;
|
||||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||||
//斜体变红
|
//斜体变红
|
||||||
@@ -1144,7 +1220,6 @@ class Journal extends Controller {
|
|||||||
$re['articles'] = $list;
|
$re['articles'] = $list;
|
||||||
$re['count'] = $count;
|
$re['count'] = $count;
|
||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -579,4 +579,5 @@ class Main extends Controller {
|
|||||||
// die;
|
// die;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -175,3 +175,39 @@ function myPost($url, $param=array()){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ORCIDPost($url, $param=array()){
|
||||||
|
|
||||||
|
if(!is_array($param)){
|
||||||
|
|
||||||
|
throw new Exception("参数必须为array");
|
||||||
|
|
||||||
|
}
|
||||||
|
$headerArray = ['Content-Type: application/x-www-form-urlencoded'];
|
||||||
|
$httph =curl_init($url);
|
||||||
|
|
||||||
|
curl_setopt($httph, CURLOPT_SSL_VERIFYPEER, false);
|
||||||
|
|
||||||
|
// curl_setopt($httph, CURLOPT_SSL_VERIFYHOST, 1);
|
||||||
|
|
||||||
|
curl_setopt($httph,CURLOPT_RETURNTRANSFER,1);
|
||||||
|
|
||||||
|
curl_setopt($httph, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");
|
||||||
|
|
||||||
|
curl_setopt($httph, CURLOPT_POST, 1);//设置为POST方式
|
||||||
|
|
||||||
|
curl_setopt($httph, CURLOPT_POSTFIELDS, $param);
|
||||||
|
|
||||||
|
curl_setopt($httph, CURLOPT_HTTPHEADER,$headerArray);
|
||||||
|
|
||||||
|
// curl_setopt($httph, CURLOPT_RETURNTRANSFER,0);
|
||||||
|
|
||||||
|
// curl_setopt($httph, CURLOPT_HEADER,1);
|
||||||
|
|
||||||
|
$rst=curl_exec($httph);
|
||||||
|
|
||||||
|
curl_close($httph);
|
||||||
|
|
||||||
|
return $rst;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -434,9 +434,6 @@ class Article extends Controller {
|
|||||||
* @param name:doi type:string require:1 desc:doi
|
* @param name:doi type:string require:1 desc:doi
|
||||||
* @param name:abstract type:string require:1 desc:简介
|
* @param name:abstract type:string require:1 desc:简介
|
||||||
* @param name:keywords type:string require:1 desc:关键字
|
* @param name:keywords type:string require:1 desc:关键字
|
||||||
* @param name:abs_num type:int require:1 desc:简介数量
|
|
||||||
* @param name:pdf_num type:int require:1 desc:pdf数量
|
|
||||||
* @param name:html_num type:int require:1 desc:html数量
|
|
||||||
* @param name:ltai type:string require:0 desc:标题斜体(demo1,demo2)
|
* @param name:ltai type:string require:0 desc:标题斜体(demo1,demo2)
|
||||||
* @param name:npp type:strng require:1 desc:文章页码
|
* @param name:npp type:strng require:1 desc:文章页码
|
||||||
* @param name:type type:string require:1 desc:类型
|
* @param name:type type:string require:1 desc:类型
|
||||||
@@ -462,9 +459,9 @@ class Article extends Controller {
|
|||||||
$updata['doi'] = $data['doi'];
|
$updata['doi'] = $data['doi'];
|
||||||
$updata['abstract'] = $data['abstract'];
|
$updata['abstract'] = $data['abstract'];
|
||||||
$updata['keywords'] = $data['keywords'];
|
$updata['keywords'] = $data['keywords'];
|
||||||
$updata['abs_num'] = $data['abs_num'];
|
// $updata['abs_num'] = $data['abs_num'];
|
||||||
$updata['pdf_num'] = $data['pdf_num'];
|
// $updata['pdf_num'] = $data['pdf_num'];
|
||||||
$updata['html_num'] = $data['html_num'];
|
// $updata['html_num'] = $data['html_num'];
|
||||||
$updata['npp'] = $data['npp'];
|
$updata['npp'] = $data['npp'];
|
||||||
$updata['type'] = $data['type'];
|
$updata['type'] = $data['type'];
|
||||||
$updata['cited'] = $data['cited'];
|
$updata['cited'] = $data['cited'];
|
||||||
@@ -1018,4 +1015,116 @@ class Article extends Controller {
|
|||||||
$re['cites'] = $list;
|
$re['cites'] = $list;
|
||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 注册doi
|
||||||
|
* @description 注册doi
|
||||||
|
* @author wangjinlei
|
||||||
|
* @url /master/Article/agentDOI
|
||||||
|
* @method POST
|
||||||
|
*
|
||||||
|
* @param name:doi type:string require:1 desc:doi号
|
||||||
|
* @param name:article_id type:int require:1 desc:文章id
|
||||||
|
*/
|
||||||
|
public function agentDOI(){
|
||||||
|
$data = $this->request->post();
|
||||||
|
$data['doi'] = '10.12032/TMR20210301222';
|
||||||
|
$data['article_id'] = 1333;
|
||||||
|
|
||||||
|
|
||||||
|
$xml = '';
|
||||||
|
//create xml 头
|
||||||
|
$xml .= '<?xml version="1.0" encoding="UTF-8"?>'.PHP_EOL;
|
||||||
|
$xml .= '<doi_batch version="1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="D:\jboss-4.0.3SP1\wanfang\jboss-4.0.3SP1\server\default\deploy\WanFang.war\check.xsd">'.PHP_EOL.PHP_EOL;
|
||||||
|
$xml .= '<head>'.PHP_EOL;
|
||||||
|
$xml .= '<doi_batch_id>'.date('Ymd').'</doi_batch_id>'.PHP_EOL;
|
||||||
|
$xml .= '<timestamp>'.date('YmdHis').'</timestamp>'.PHP_EOL;
|
||||||
|
$xml .= '<depositor>'.PHP_EOL;
|
||||||
|
$xml .= '<name>TMR2015@163.com</name>'.PHP_EOL;
|
||||||
|
$xml .= '<email_address>TMR2015@163.com</email_address>'.PHP_EOL;
|
||||||
|
$xml .= '</depositor>'.PHP_EOL;
|
||||||
|
$xml .= '<registrant>传统医学研究(英文版)</registrant>'.PHP_EOL;
|
||||||
|
$xml .= '</head>'.PHP_EOL;
|
||||||
|
|
||||||
|
//组装主体信息部分
|
||||||
|
$article_info = $this->article_obj->where('article_id',$data['article_id'])->find();
|
||||||
|
$journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find();
|
||||||
|
$stage_info = $this->journal_stage_obj->where('journal_stage_id',$article_info['journal_stage_id'])->find();
|
||||||
|
$xml .= '<body>'.PHP_EOL;
|
||||||
|
$xml .= '<journal>'.PHP_EOL;
|
||||||
|
$xml .= '<journal_metadata>'.PHP_EOL;
|
||||||
|
$xml .= '<journal_id>'.$journal_info['usx'].'</journal_id>'.PHP_EOL;
|
||||||
|
$xml .= '<full_title>'.$journal_info['title'].'</full_title>'.PHP_EOL;
|
||||||
|
$xml .= '<issn media_type="print">'.$journal_info['issn'].'</issn>'.PHP_EOL;
|
||||||
|
$xml .= '<cn media_type="print"></cn>'.PHP_EOL;
|
||||||
|
$xml .= '</journal_metadata>'.PHP_EOL;
|
||||||
|
$xml .= '<journal_issue>'.PHP_EOL;
|
||||||
|
$xml .= '<publication_date media_type="print">'.PHP_EOL;
|
||||||
|
$xml .= '<year>'.$stage_info['stage_year'].'</year>'.PHP_EOL;
|
||||||
|
$xml .= '<month/>'.PHP_EOL;
|
||||||
|
$xml .= '<day/>'.PHP_EOL;
|
||||||
|
$xml .= '</publication_date>'.PHP_EOL;
|
||||||
|
$xml .= '<journal_volume>'.PHP_EOL;
|
||||||
|
$xml .= '<volume>'.$stage_info['stage_vol'].'</volume>'.PHP_EOL;
|
||||||
|
$xml .= '</journal_volume>'.PHP_EOL;
|
||||||
|
$xml .= '<issue>'.$stage_info['stage_no'].'</issue>'.PHP_EOL;
|
||||||
|
$xml .= '</journal_issue>'.PHP_EOL;
|
||||||
|
$xml .= '<journal_article>'.PHP_EOL;
|
||||||
|
$xml .= '<titles>'.PHP_EOL;
|
||||||
|
$xml .= '<title>'.$article_info['title'].'</title>'.PHP_EOL;
|
||||||
|
$xml .= '<subtitle></subtitle>'.PHP_EOL;
|
||||||
|
$xml .= '</titles>'.PHP_EOL;
|
||||||
|
$xml .= '<contributors>'.PHP_EOL;
|
||||||
|
$xml .= '<contributors>'.PHP_EOL;
|
||||||
|
$authors = $this->article_author_obj->where('article_id',$data['article_id'])->where('state',0)->select();
|
||||||
|
$address = '';
|
||||||
|
$author = '';
|
||||||
|
foreach ($authors as $v){
|
||||||
|
if($v['is_first']==1){
|
||||||
|
$ca = $this->author_to_organ_obj->where('article_author_id',$v['article_author_id'])->where('article_id',$data['article_id'])->find();
|
||||||
|
$ca_organ = $this->article_organ_obj->where('article_organ_id',$ca['article_organ_id'])->find();
|
||||||
|
$address = $ca_organ['organ_name'];
|
||||||
|
}
|
||||||
|
$author .= $v['author_name'].',';
|
||||||
|
}
|
||||||
|
$xml .= '<person_name sequence="first" contributor_role="author">'.substr($author,-1).'</person_name>'.PHP_EOL;
|
||||||
|
$xml .= '<organization sequence="first" contributor_role="author">'.$address.'</organization>'.PHP_EOL;
|
||||||
|
$xml .= '</contributors>'.PHP_EOL;
|
||||||
|
$xml .= '<keywords></keywords>'.PHP_EOL;
|
||||||
|
$xml .= '<keywords>'. str_replace(',', ' ', $article_info['keywords']).'</keywords>'.PHP_EOL;
|
||||||
|
$xml .= '<abstract></abstract>'.PHP_EOL;
|
||||||
|
$xml .= '<abstract>'.str_replace('Abstract','',strip_tags(str_replace(" ","",htmlspecialchars_decode($article_info['abstract'])))).'</abstract>'.PHP_EOL;
|
||||||
|
$xml .= '<doi_data>'.PHP_EOL;
|
||||||
|
$xml .= '<doi>'.$article_info['doi'].'</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 .= '</doi_data>'.PHP_EOL;
|
||||||
|
$xml .= '<pages>'.PHP_EOL;
|
||||||
|
$start = '';
|
||||||
|
$end = '';
|
||||||
|
if(stripos($article_info['npp'],'-')>0){
|
||||||
|
$ca_list = explode('-', $article_info['npp']);
|
||||||
|
$start = $ca_list[0];
|
||||||
|
$end = $ca_list[1];
|
||||||
|
}else{
|
||||||
|
$start = $article_info['npp'];
|
||||||
|
}
|
||||||
|
$xml .= '<first_page>'.$start.'</first_page>'.PHP_EOL;
|
||||||
|
$xml .= '<last_page>'.$end.'</last_page>'.PHP_EOL;
|
||||||
|
$xml .= '</pages>'.PHP_EOL;
|
||||||
|
$xml .= '</journal_article>'.PHP_EOL;
|
||||||
|
$txt = ROOT_PATH . 'public' . DS . 'xml'.DS.$article_info['article_id'].'.xml';
|
||||||
|
file_put_contents($txt, $xml);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function upXML(){
|
||||||
|
vendor("chinadoi.UPXML2");
|
||||||
|
$up_obj = new \UpXml;
|
||||||
|
$xmlfile = ROOT_PATH . 'public' . DS . 'xml'.DS.'1333.xml';
|
||||||
|
$result = $up_obj->upload($xmlfile);
|
||||||
|
echo '<pre>';
|
||||||
|
var_dump($result);
|
||||||
|
echo '</pre>';
|
||||||
|
die;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user