20201112
This commit is contained in:
@@ -186,7 +186,11 @@ class Article extends Controller {
|
||||
$list = $this->article_author_obj->where($where)->select();
|
||||
$frag = '';
|
||||
foreach ($list as $k => $v) {
|
||||
$frag = $frag == '' ? '' . $v['author_name'] : $frag . ', ' . $v['author_name'];
|
||||
$ca = '';
|
||||
if($v['orcid']!=''){
|
||||
$ca = '<a href="https://orcid.org/'.$v['orcid'].'" target="_blank"><img src="img/or_id.png" alt="" style="width: 13px;margin-left: 3px;"></a>';
|
||||
}
|
||||
$frag = $frag == '' ? '' . $v['author_name'].$ca : $frag . ', ' . $v['author_name'].$ca;
|
||||
}
|
||||
return $frag;
|
||||
}
|
||||
|
||||
@@ -306,7 +306,11 @@ class Journal extends Controller {
|
||||
$list = $this->article_author_obj->where($where)->select();
|
||||
$frag = '';
|
||||
foreach ($list as $k => $v) {
|
||||
$frag = $frag == '' ? '' . $v['author_name'] : $frag . ', ' . $v['author_name'];
|
||||
$ca = '';
|
||||
if($v['orcid']!=''){
|
||||
$ca = '<a href="https://orcid.org/'.$v['orcid'].'" target="_blank"><img src="img/or_id.png" alt="" style="width: 13px;margin-left: 3px;"></a>';
|
||||
}
|
||||
$frag = $frag == '' ? '' . $v['author_name'].$ca : $frag . ', ' . $v['author_name'].$ca;
|
||||
}
|
||||
return $frag;
|
||||
}
|
||||
@@ -719,7 +723,14 @@ class Journal extends Controller {
|
||||
*/
|
||||
public function getTopicForSubscribe() {
|
||||
$data = $this->request->post();
|
||||
$list = $this->journal_topic_obj->where('journal_id', $data['journal_id'])->where('state', 0)->where('is_final', 1)->select();
|
||||
$list = $this->journal_topic_obj->where('journal_id', $data['journal_id'])->where('state', 0)->where('level', 2)->select();
|
||||
// $pids = [];
|
||||
// foreach ($list as $k => $v){
|
||||
// if(!in_array($v['parent_id'], $pids)){
|
||||
// $pids[] = $v['parent_id'];
|
||||
// }
|
||||
// }
|
||||
// $tlist = $this->journal_topic_obj->where('journal_topic_id','in',$pids)->where('state',0)->select();
|
||||
|
||||
$re['topics'] = $list;
|
||||
return jsonSuccess($re);
|
||||
@@ -767,6 +778,33 @@ class Journal extends Controller {
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
public function pushEmail(){
|
||||
die;
|
||||
$list = $this->subscribe_journal_obj->where('journal_id',1)->select();
|
||||
|
||||
// $a = [];
|
||||
// $a[] = ['email'=>'751475802@qq.com'];
|
||||
// $a[] = ['email'=>'13662001490@126.com'];
|
||||
foreach ($list as $v){
|
||||
$tt = 'Dear Researcher,<br><br>';
|
||||
$tt .= 'We are so kindly to bring you a notice that we are glad to invite eminent people as the Reviewer for Traditional Medicine Research (ISSN 2413-3973).<br><br>';
|
||||
$tt .= 'Traditional Medicine Research has been included in Emerging Sources Citation Index (ESCI), Embase, DOAJ, ProQuest, J-Gate, EuroPub, WHO-COVID-19 Database, Google Scholar, EBSCO, ect.<br><br>';
|
||||
$tt .= 'TMR is a bimonthly, peer-reviewed open access journal. It is dedicated to report the research of the progress in clinical efficacy, action mechanism and theoretical research in the traditional medicine field. Including traditional medicine, ethnomedicine, herbal medicine, acupuncture and massage, rehabilitation, diet therapy, yoga, and other integrative medicine all over the world.<br><br>';
|
||||
$tt .= 'If you interested in our invitation, please kindly send us your Resume and Photograph a d Email address to our Editorial office.<br><br>';
|
||||
$tt .= 'Thank you for your attention to our invitation. If you have any questions, do not hesitate to contact us at tmr@tmrjournals.com. we look forward to a favorable reply.<br><br>';
|
||||
$tt .= 'Best wishes,<br><br>';
|
||||
$tt .= 'Editorial Office-Traditional Medicine Research<br>';
|
||||
$tt .= 'Email: tmr@tmrjournals.com<br>';
|
||||
$tt .= 'Traditional Medicine Research (TMR)';
|
||||
$maidata['email'] = $v['email'];
|
||||
$maidata['title'] = 'Traditional Medicine Research ISSN 2413-3973';
|
||||
$maidata['content'] = $tt;
|
||||
$maidata['tmail'] = 'publicrelations@tmrjournals.com';
|
||||
$maidata['tpassword'] = 'pRWU999999';
|
||||
Queue::push('app\api\job\mail@fire', $maidata, "mail");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 添加期刊话题订阅(批量)
|
||||
* @description 添加期刊话题订阅(批量)
|
||||
|
||||
@@ -523,7 +523,11 @@ class Main extends Controller {
|
||||
$list = $this->article_author_obj->where($where)->select();
|
||||
$frag = '';
|
||||
foreach ($list as $k => $v) {
|
||||
$frag = $frag == '' ? '' . $v['author_name'] : $frag . ', ' . $v['author_name'];
|
||||
$ca = '';
|
||||
if($v['orcid']!=''){
|
||||
$ca = '<a href="https://orcid.org/'.$v['orcid'].'" target="_blank"><img src="img/or_id.png" alt="" style="width: 13px;margin-left: 3px;"></a>';
|
||||
}
|
||||
$frag = $frag == '' ? '' . $v['author_name'].$ca : $frag . ', ' . $v['author_name'].$ca;
|
||||
}
|
||||
return $frag;
|
||||
}
|
||||
|
||||
@@ -288,6 +288,11 @@ class Special extends Controller {
|
||||
$list = $this->article_author_obj->where($where)->select();
|
||||
$frag = '';
|
||||
foreach ($list as $k => $v) {
|
||||
$ca = '';
|
||||
if($v['orcid']!=''){
|
||||
$ca = '<a href="https://orcid.org/'.$v['orcid'].'" target="_blank"><img src="img/or_id.png" alt="" style="width: 13px;margin-left: 3px;"></a>';
|
||||
}
|
||||
$frag = $frag == '' ? '' . $v['author_name'].$ca : $frag . ', ' . $v['author_name'].$ca;
|
||||
$frag = $frag == '' ? '' . $v['author_name'] : $frag . ', ' . $v['author_name'];
|
||||
}
|
||||
return $frag;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace app\master\controller;
|
||||
|
||||
use think\Controller;
|
||||
@@ -11,6 +12,7 @@ use think\Queue;
|
||||
* @group 文章相关
|
||||
*/
|
||||
class Article extends Controller {
|
||||
|
||||
//put your code here
|
||||
protected $admin_obj = '';
|
||||
protected $journal_obj = '';
|
||||
@@ -131,6 +133,7 @@ class Article extends Controller {
|
||||
* @param name:article_id type:int require:1 desc:article_id
|
||||
* @param name:author_name type:string require:1 desc:作者名字
|
||||
* @param name:author_country type:string require:1 desc:国家
|
||||
* @param name:orcid type:string require:0 desc:orcid
|
||||
* @param name:is_first type:boolean require:1 default:0 desc:是否第一作者(1yes0no)
|
||||
* @param name:is_report type:boolean require:1 default:0 desc:是否通讯作者(1yes0no)
|
||||
* @param name:email type:string require:0 desc:邮箱
|
||||
@@ -154,6 +157,7 @@ class Article extends Controller {
|
||||
}
|
||||
$insert_author['first_name'] = $caf;
|
||||
$insert_author['last_name'] = $cal;
|
||||
$insert_author['orcid'] = isset($data['orcid']) ? $data['orcid'] : '';
|
||||
$insert_author['author_country'] = $data['author_country'];
|
||||
$insert_author['is_first'] = $data['is_first'];
|
||||
$insert_author['is_report'] = $data['is_report'];
|
||||
@@ -187,6 +191,7 @@ class Article extends Controller {
|
||||
*
|
||||
* @param name:article_author_id type:int require:1 desc:article_id
|
||||
* @param name:author_name type:string require:1 desc:作者名字
|
||||
* @param name:orcid type:string require:0 desc:orcid
|
||||
* @param name:author_country type:string require:1 desc:国家
|
||||
* @param name:is_first type:boolean require:1 default:0 desc:是否第一作者(1yes0no)
|
||||
* @param name:is_report type:boolean require:1 default:0 desc:是否通讯作者(1yes0no)
|
||||
@@ -220,7 +225,7 @@ class Article extends Controller {
|
||||
}
|
||||
$update_author['first_name'] = $caf;
|
||||
$update_author['last_name'] = $cal;
|
||||
|
||||
$update_author['orcid'] = isset($data['orcid']) ? $data['orcid'] : '';
|
||||
$update_author['author_country'] = $data['author_country'];
|
||||
$update_author['is_first'] = $data['is_first'];
|
||||
$update_author['is_report'] = $data['is_report'];
|
||||
@@ -477,6 +482,7 @@ class Article extends Controller {
|
||||
// return json(['code'=>1,'msg'=>'system error']);
|
||||
// }
|
||||
}
|
||||
|
||||
private function editArticleLtai($ltai, $article_id) {
|
||||
$list = explode(',', $ltai);
|
||||
$has = $this->article_ltai_obj->where('article_id', $article_id)->where('state', 0)->select();
|
||||
@@ -500,7 +506,6 @@ class Article extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @title 编辑文章文件信息
|
||||
* @description 编辑文章文件信息
|
||||
@@ -607,6 +612,7 @@ class Article extends Controller {
|
||||
$now_list = $this->article_to_topic_obj->where('article_id', $data['article_id'])->where('state', 0)->select();
|
||||
return json(['code' => 0, 'msg' => 'success', 'data' => ['nowtopic' => $now_list, 'topics' => $frag]]);
|
||||
}
|
||||
|
||||
private function getTname($now, $arr) {
|
||||
if ($now['parent_id'] == 0) {
|
||||
return $now['title'];
|
||||
@@ -650,7 +656,13 @@ class Article extends Controller {
|
||||
$stage_info = $this->journal_stage_obj->where('journal_stage_id', $article_info['journal_stage_id'])->find();
|
||||
$topic_info = $this->journal_topic_obj->where('journal_topic_id', $topic_id)->find();
|
||||
$journal_info = $this->journal_obj->where('journal_id', $article_info['journal_id'])->find();
|
||||
$list = [];
|
||||
if ($topic_info['level'] == 2) {
|
||||
$list = $this->subscribe_topic_obj->where('topic_id', $topic_id)->where('state', 0)->select();
|
||||
} else {
|
||||
$list = $this->subscribe_topic_obj->where('topic_id', $topic_info['parent_id'])->where('state', 0)->select();
|
||||
}
|
||||
|
||||
//组成文章信息
|
||||
$tt1 = '<div style="background-color: #ededed;margin: 0;">
|
||||
<div class="con_content" style="font-family: Arial;
|
||||
@@ -686,10 +698,11 @@ class Article extends Controller {
|
||||
$maidata['title'] = $journal_info['title'];
|
||||
$maidata['content'] = $cache;
|
||||
$maidata['tmail'] = 'publicrelations@tmrjournals.com';
|
||||
$maidata['tpassword'] = 'pRWU999999';
|
||||
$maidata['tpassword'] = '999999Wu';
|
||||
Queue::push('app\api\job\mail@fire', $maidata, "mail");
|
||||
}
|
||||
}
|
||||
|
||||
private function getAuthor($article) {
|
||||
$where['article_id'] = $article['article_id'];
|
||||
$where['state'] = 0;
|
||||
@@ -1016,6 +1029,157 @@ class Article extends Controller {
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 推送crossref
|
||||
* @description 推送crossref
|
||||
* @author wangjinlei
|
||||
* @url /master/Article/pushCrossref
|
||||
* @method POST
|
||||
*
|
||||
* @param name:doi_num type:string require:1 desc:doi号
|
||||
* @param name:article_id type:int require:1 desc:文章id
|
||||
*/
|
||||
public function pushCrossref() {
|
||||
$data = $this->request->post();
|
||||
|
||||
$has = $this->article_obj->where('doi','10.53388/'.$data['doi_num'])->find();
|
||||
if($has){
|
||||
return jsonError('doi号重复');
|
||||
}
|
||||
if(strstr($data['doi_num'],'/')!==false){
|
||||
return jsonError('格式错误');
|
||||
}
|
||||
$author = $this->article_author_obj->where('article_id', $data['article_id'])->where('state', 0)->find();
|
||||
if($author==null){
|
||||
return jsonError('请先上传作者');
|
||||
}
|
||||
$article_info = $this->article_obj->where('article_id', $data['article_id'])->find();
|
||||
if($article_info['npp']==''){
|
||||
return jsonError('请先上传页码');
|
||||
}
|
||||
$url = 'https://doi.crossref.org/servlet/deposit';
|
||||
$file = ROOT_PATH . 'public' . DS . 'xml' . DS . $data['article_id'] . '.xml';
|
||||
$this->crossRef($data);
|
||||
|
||||
//存储
|
||||
$this->article_obj->where('article_id',$data['article_id'])->update(['doi'=>'10.53388/'.$data['doi_num']]);
|
||||
|
||||
//发送请求
|
||||
$par['login_id'] = 'books@tmrjournals.com/tmrp';
|
||||
$par['login_passwd'] = '849192806pnX';
|
||||
$par['fname'] = new \CURLFile($file);
|
||||
|
||||
$this->myPost($url, $par);
|
||||
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
private function myPost($url, $param = array()) {
|
||||
if (!is_array($param)) {
|
||||
throw new Exception("参数必须为array");
|
||||
}
|
||||
$httph = curl_init($url);
|
||||
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_exec($httph);
|
||||
curl_close($httph);
|
||||
// echo '<pre>';
|
||||
// var_dump($rst);
|
||||
// echo '</pre>';
|
||||
// echo '<pre>';
|
||||
// var_dump($err);
|
||||
// echo '</pre>';
|
||||
// die;
|
||||
// die;
|
||||
}
|
||||
|
||||
public function met(){
|
||||
$s = '11';
|
||||
$arr = explode('-', $s);
|
||||
echo $arr[0];
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function crossRef($data) {
|
||||
$xml = '';
|
||||
//create xml 头
|
||||
$xml .= '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL;
|
||||
$xml .= '<doi_batch version="4.3.7" xmlns="http://www.crossref.org/schema/4.3.7" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.crossref.org/schema/4.3.7
|
||||
http://www.crossref.org/schemas/crossref4.3.7.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 .= '<depositor_name>tmr@tmrjournals.com</depositor_name>' . PHP_EOL;
|
||||
$xml .= '<email_address>tmr@tmrjournals.com</email_address>' . PHP_EOL;
|
||||
$xml .= '</depositor>' . PHP_EOL;
|
||||
$xml .= '<registrant>TMR</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 language="en">' . PHP_EOL;
|
||||
$xml .= '<full_title>' . $journal_info['title'] . '</full_title>' . PHP_EOL;
|
||||
$xml .= '<abbrev_title>' . $journal_info['jabbr'] . '</abbrev_title>' . PHP_EOL;
|
||||
$xml .= '<issn media_type="print">' . $journal_info['issn'] . '</issn>' . PHP_EOL;
|
||||
$xml .= '<coden>' . $journal_info['usx'] . '</coden>' . 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 .= '</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 publication_type="full_text">' . PHP_EOL;
|
||||
$xml .= '<titles>' . PHP_EOL;
|
||||
$xml .= '<title>' . $article_info['title'] . '</title>' . PHP_EOL;
|
||||
$xml .= '</titles>' . PHP_EOL;
|
||||
$xml .= '<contributors>' . PHP_EOL;
|
||||
$authors = $this->article_author_obj->where('article_id', $data['article_id'])->where('state', 0)->select();
|
||||
foreach ($authors as $v) {
|
||||
if ($v['is_first'] == 1) {
|
||||
$xml .= '<person_name sequence="first" contributor_role="author">' . PHP_EOL;
|
||||
} else {
|
||||
$xml .= '<person_name sequence="additional" contributor_role="author">' . PHP_EOL;
|
||||
}
|
||||
$xml .= '<given_name>' . $v['first_name'] . '</given_name>' . PHP_EOL;
|
||||
$xml .= '<surname>' . $v['last_name'] . '</surname>' . PHP_EOL;
|
||||
$xml .= '</person_name>' . PHP_EOL;
|
||||
}
|
||||
$xml .= '</contributors>' . PHP_EOL;
|
||||
$xml .= '<publication_date media_type="print">' . PHP_EOL;
|
||||
$xml .= '<year>' . $stage_info['stage_year'] . '</year>' . PHP_EOL;
|
||||
$xml .= '</publication_date>' . PHP_EOL;
|
||||
$xml .= '<pages>' . PHP_EOL;
|
||||
$ca = explode('-', $article_info['npp']);
|
||||
$xml .= '<first_page>' . $ca[0] . '</first_page>' . PHP_EOL;
|
||||
$xml .= '</pages>' . PHP_EOL;
|
||||
$xml .= '<publisher_item>' . PHP_EOL;
|
||||
$xml .= '<identifier id_type="pii">'.trim($data['doi_num']).'</identifier>' . PHP_EOL;
|
||||
$xml .= '</publisher_item>' . PHP_EOL;
|
||||
$xml .= '<doi_data>' . 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 .= '</doi_data>' . PHP_EOL;
|
||||
$xml .= '</journal_article>' . PHP_EOL;
|
||||
$xml .= '</journal>' . PHP_EOL;
|
||||
$xml .= '</body>' . PHP_EOL;
|
||||
$xml .= '</doi_batch>' . PHP_EOL;
|
||||
$txt = ROOT_PATH . 'public' . DS . 'xml' . DS . $article_info['article_id'] . '.xml';
|
||||
file_put_contents($txt, $xml);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 注册doi
|
||||
* @description 注册doi
|
||||
@@ -1114,7 +1278,6 @@ class Article extends Controller {
|
||||
$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() {
|
||||
@@ -1127,4 +1290,5 @@ class Article extends Controller {
|
||||
echo '</pre>';
|
||||
die;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -663,7 +663,13 @@ class Journal extends Controller {
|
||||
$stage_info = $this->journal_stage_obj->where('journal_stage_id', $article_info['journal_stage_id'])->find();
|
||||
$topic_info = $this->journal_topic_obj->where('journal_topic_id',$topic_id)->find();
|
||||
$journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find();
|
||||
$list = [];
|
||||
if($topic_info['level']==2){
|
||||
$list = $this->subscribe_topic_obj->where('topic_id',$topic_id)->where('state',0)->select();
|
||||
}else{
|
||||
$list = $this->subscribe_topic_obj->where('topic_id',$topic_info['parent_id'])->where('state',0)->select();
|
||||
}
|
||||
// $list = $this->subscribe_topic_obj->where('topic_id',$topic_info['parent_id'])->where('state',0)->select();
|
||||
//组成文章信息
|
||||
$tt1 = '<div style="background-color: #ededed;margin: 0;">
|
||||
<div class="con_content" style="font-family: Arial;
|
||||
@@ -699,7 +705,7 @@ class Journal extends Controller {
|
||||
$maidata['title'] = $journal_info['title'];
|
||||
$maidata['content'] = $cache;
|
||||
$maidata['tmail'] = 'publicrelations@tmrjournals.com';
|
||||
$maidata['tpassword'] = 'pRWU999999';
|
||||
$maidata['tpassword'] = '999999Wu';
|
||||
Queue::push('app\api\job\mail@fire', $maidata, "mail");
|
||||
}
|
||||
}
|
||||
@@ -1071,7 +1077,7 @@ class Journal extends Controller {
|
||||
$maidata['title'] = $journal_info['title'];
|
||||
$maidata['content'] = $cache;
|
||||
$maidata['tmail'] = 'publicrelations@tmrjournals.com';
|
||||
$maidata['tpassword'] = 'pRWU999999';
|
||||
$maidata['tpassword'] = '999999Wu';
|
||||
Queue::push('app\api\job\mail@fire', $maidata, "mail");
|
||||
echo $v['email'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user