This commit is contained in:
wangjinlei
2022-08-16 16:37:31 +08:00
parent c42decfe99
commit cfac81c806
3 changed files with 76 additions and 10 deletions

View File

@@ -339,7 +339,7 @@ function aliemail($email,$title,$content){
$mailsubject = "=?UTF-8?B?" . base64_encode($mailsubject) . "?=";
$mailtype = "HTML";
//可选,设置回信地址
$smtpreplyto = "13662001490@126.com";
$smtpreplyto = "tmr@tmrjournals.com";
$smtp = new \smtp($smtpserver, $smtpserverport, true, $smtpuser, $smtppass);
$smtp->debug = false;
$cc ="";

View File

@@ -5,6 +5,7 @@ namespace app\master\controller;
use think\Controller;
use think\Db;
use think\Queue;
use think\Validate;
/**
* @title 文章接口
@@ -1430,6 +1431,13 @@ http://www.crossref.org/schemas/crossref4.3.7.xsd">' . PHP_EOL . PHP_EOL;
*/
public function addRelatedArticle(){
$data = $this->request->post();
$rule = new Validate([
'article_id'=>'require',
'add_article_id'=>'require'
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$article_info = $this->article_obj->where('article_id',$data['article_id'])->find();
$frag = [];
if($article_info['related']==""){
@@ -1481,14 +1489,18 @@ http://www.crossref.org/schemas/crossref4.3.7.xsd">' . PHP_EOL . PHP_EOL;
public function getRelatedArticles(){
$data = $this->request->post();
$article_info = $this->article_obj->where("article_id",$data['article_id'])->find();
$list = $this->article_obj->where("article_id","in", object_to_array(json_decode($article_info['related'])))->select();
$list = $this->article_obj
->field("j_article.*,j_journal.title journal_title")
->join('j_journal','j_journal.journal_id = j_article.journal_id','left')
->where("j_article.article_id","in", object_to_array(json_decode($article_info['related'])))
->select();
$re['articles'] = $list;
return jsonSuccess($re);
}
/**
* @title 获取期刊分期文章
* @description 获取期刊分期文章
* @title 获取期刊全部文章按分期划
* @description 获取期刊全部文章按分期划
* @author wangjinlei
* @url /master/Article/getArticlesByStages
* @method POST

View File

@@ -766,6 +766,53 @@ class Journal extends Controller
}
}
/**
* 推送邮件给编委
*/
private function pushEmailToBoardByJournal(){
$data = $this->request->post();
$rule = new Validate([
'journal_id' => 'require'
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
$boards = $this->board_obj->where('journal_id',$data['journal_id'])->where('type',2)->where('state',0)->select();
$tt = "Life Research journal is currently applying for Web of Science Core Collection (SCI), and we have received modification comments from Web of Science Editorial Team. Life Research is expected to be indexed in SCI in two years. <br><br>";
$tt .= "According to the opinions, the editorial board of Life Research journal needs to be reorganized. <strong>Please send the URL of your latest publication record (ORCID or ResearchGate) to this email address (liferes@tmrjournals.com)</strong>. We will choose new editorial board members based on the latest publication record. If you cannot respond within two weeks, you will be temporarily removed from the editorial board list until you send us the publication record.<br><br>";
$tt .= "Thank you very much for your support.<br><br>";
$tt .= "Life Research Editorial Team";
// $name = 'haoRan Zhang';
// // $maidata['email'] = 'liferes@tmrjournals.com';
// $maidata['email'] = '751475802@qq.com';
// $maidata['title'] = 'Please send the URL of your latest publication record (Life Research)';
// $maidata['content'] = "Dear ".$name.",<br><br>".$tt;
// // $maidata['tmail'] = $journal_info['email'];
// // $maidata['tpassword'] = $journal_info['epassword'];
// $maidata['tmail'] = 'liferes@tmrjournals.com';
// $maidata['tpassword'] = 'Wu999999lifere';
// Queue::push('app\api\job\mail@fire', $maidata, "mail");
// $r = sendEmail($maidata['email'],$maidata['title'],$maidata['title'],$maidata['content'],$maidata['tmail'],$maidata['tpassword']);
foreach($boards as $v){
if($v['email']==''){
continue;
}
$maidata['email'] = $v['email'];
$maidata['title'] = 'Please send the URL of your latest publication record (Life Research)';
$maidata['content'] = "Dear ".$v['name'].",<br><br>".$tt;
$maidata['tmail'] = $journal_info['email'];
$maidata['tpassword'] = $journal_info['epassword'];
Queue::push('app\api\job\mail@fire', $maidata, "mail");
// Queue::push('app\api\job\mail@propa', $maidata, "mail");
}
return jsonSuccess([]);
}
/**
* 发送邮件至审稿人
*/
@@ -783,7 +830,7 @@ class Journal extends Controller
if($cache_res['code']==0){
$emails =$cache_res['data']['reviewers'];
foreach($emails as $val){
$frag[] = $val['email'];
$frag[] = $val;
}
}
}
@@ -806,15 +853,22 @@ class Journal extends Controller
}
$frag1 = [];
$frag1[] = '751475802@qq.com';
$frag1[] = '849192806@qq.com';
$frag1[] = '13662001490@126.com';
$frag1[] = [
'user_id'=>54,
'email'=>'751475802@qq.com'
];
$frag1[] = [
'user_id'=>28,
'email'=>'849192806@qq.com'
];
foreach($frag as $v){
$maidata['email'] = $v;
$cache_tt = $tt.'<a href="http://api.tmrjournals.com/public/index.php/api/User/unAdvertForUser/uid/' . $v['user_id'] . '">Unsubscribe</a>';
$maidata['email'] = $v['email'];
$maidata['title'] = "Traditional Medicine Research will get the first Impact Factor (WOS) in 2023";
$maidata['content'] = $tt;
$maidata['content'] = $cache_tt;
// $maidata['tmail'] = 'publicrelations@tmrjournals.com';
// $maidata['tpassword'] = 'pRWU999999';
// $maidata['tmail'] = 'ghr@tmrjournals.com';