This commit is contained in:
Administrator
2022-03-25 15:42:31 +08:00
parent 44cbb62a4e
commit 98f1944b39
4 changed files with 347 additions and 184 deletions

View File

@@ -20,6 +20,7 @@ class Auto extends Controller {
protected $rev_to_jour_obj = '';
protected $reviewer_obj = '';
protected $journal_obj = '';
protected $login_auto_obj = '';
protected $article_msg_obj = '';
protected $user_log_obj = '';
protected $reviewer_info_obj = '';
@@ -29,8 +30,7 @@ class Auto extends Controller {
$this->article_obj = Db::name('article');
$this->article_reviewer_obj = Db::name('article_reviewer');
$this->user_obj = Db::name('user');
$this->login_auto_obj = Db::name('login_auto');
$this->rev_to_jour_obj = Db::name('reviewer_to_journal');
$this->journal_obj = Db::name('journal');
$this->reviewer_obj = Db::name('article_reviewer');
@@ -38,10 +38,9 @@ class Auto extends Controller {
$this->user_log_obj = Db::name('user_log');
$this->reviewer_info_obj = Db::name('user_reviewer_info');
}
public function testEmail(){
$journal_info = $this->journal_obj->where('journal_id',4)->find();
public function testEmail() {
$journal_info = $this->journal_obj->where('journal_id', 4)->find();
$maidata['email'] = "751475802@qq.com";
$maidata['title'] = "test email";
$maidata['content'] = "test content";
@@ -50,23 +49,20 @@ class Auto extends Controller {
// Queue::push('app\api\job\mail@fire', $maidata, "tmail");
sendEmail($maidata['email'], $journal_info['title'], $journal_info['title'], $maidata['title'], $journal_info['email'], $journal_info['epassword']);
}
public function resetReviewerPassword(){
public function resetReviewerPassword() {
$list = $this->user_obj
->field("t_user.*")
->join("t_user_reviewer_info","t_user_reviewer_info.reviewer_id = t_user.user_id","left")
->where("t_user_reviewer_info.reviewer_info_id",">",0)
->where("t_user.password","e9f5c5240c0bb39488e6dbfbdb1517e0")
->where("t_user.state",0)
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_user.user_id", "left")
->where("t_user_reviewer_info.reviewer_info_id", ">", 0)
->where("t_user.password", "e9f5c5240c0bb39488e6dbfbdb1517e0")
->where("t_user.state", 0)
->select();
echo '<pre>';
var_dump($list);
echo '</pre>';
die;
}
/**
* 推送邮件给审稿人提醒审稿人
@@ -92,8 +88,11 @@ class Auto extends Controller {
$tt .= "Dear Dr. " . ($cache_reviewer["realname"] == "" ? $cache_reviewer["account"] : $cache_reviewer["realname"]) . "<br><br>";
$tt .= "On " . date("d D Y", $v["ctime"]) . " we sent you a request to review a paper title " . $cache_article['title'] . ".<br><br>";
$tt .= "We have not yet received a response from you, possibly because the original invitation went astray. We would be grateful if you could let us know if you can carry out this review.<br><br>";
$tt .= "If you would like to review this paper, please click <a href='https://submission.tmrjournals.com/'>this link</a>.<br><br>";
$tt .= "If you do not wish to review this paper, please click <a href='http://api.tmrjournals.com/public/index.php/api/Reviewer/refusereview/aid/" . $v['art_rev_id'] . "'>this link</a>.<br><br>";
$tt .= '<a href="' . $this->creatLoginUrlForreviewer($cache_reviewer, $v['art_rev_id']) . '">Click here to review the article</a><br>';
$tt .= '<a href="' . $this->creatRejectUrlForReviewer($cache_reviewer, $v['art_rev_id']) . '">Click on the link to reject the review of this manuscript</a><br>';
$tt .= 'Your username:'.$cache_reviewer['account'].'<br><br>';
$tt .= 'Your original password:123456qwe, if you have reset the password, please login with the new one or click the "<a href="https://submission.tmrjournals.com/retrieve">forgot password</a>".<br>';
$tt .= 'Sincerely,<br>Editorial Office<br>' . $cache_journal['title'] . '<br>';
$tt .= 'Email: ' . $cache_journal['email'] . '<br>';
$tt .= 'Website:<a href="' . $cache_journal['website'] . '">' . $cache_journal['website'] . '</a>';
@@ -108,6 +107,48 @@ class Auto extends Controller {
}
}
public function pushTestEmail() {
$cache_reviewer = $this->user_obj->where('user_id', 54)->find();
$cache_journal = $this->journal_obj->where('journal_id', 1)->find();
$cache_article = $this->article_obj->where("article_id", 1700)->find();
$tt = "Manuscript ID: " . $cache_article['accept_sn'] . "<br>";
$tt .= "Title:" . $cache_article['title'] . "<br>";
$tt .= "Dear Dr. " . ($cache_reviewer["realname"] == "" ? $cache_reviewer["account"] : $cache_reviewer["realname"]) . "<br><br>";
$tt .= "We have not yet received a response from you, possibly because the original invitation went astray. We would be grateful if you could let us know if you can carry out this review.<br><br>";
$tt .= '<a href="' . $this->creatLoginUrlForreviewer($cache_reviewer, $cache_article['art_rev_id']) . '">Click here to review the article</a><br>';
$tt .= '<a href="' . $this->creatRejectUrlForReviewer($cache_reviewer, $cache_article['art_rev_id']) . '">Click on the link to reject the review of this manuscript</a><br>';
$tt .= 'Sincerely,<br>Editorial Office<br>' . $cache_journal['title'] . '<br>';
$tt .= 'Email: ' . $cache_journal['email'] . '<br>';
$tt .= 'Website:<a href="' . $cache_journal['website'] . '">' . $cache_journal['website'] . '</a>';
$maidata['email'] = $cache_reviewer['email'];
$maidata['title'] = "Invitation to review manuscript for " . $cache_journal['title'] . " - Reminder";
$maidata['content'] = $tt;
$maidata['tmail'] = $cache_journal['email'];
$maidata['tpassword'] = $cache_journal['epassword'];
Queue::push('app\api\job\mail@fire', $maidata, "tmail");
}
private function creatLoginUrlForreviewer($user, $article_id) {
$code = md5(time() . rand(1000, 9999) . 'thinkphp');
$insert['user_id'] = $user['user_id'];
$insert['code'] = $code;
$insert['ctime'] = time();
$this->login_auto_obj->insert($insert);
$url = 'https://submission.tmrjournals.com/per_text?Art_id=' . $article_id . '&act=' . $code;
return $url;
}
private function creatRejectUrlForReviewer($user, $article_id) {
$code = md5(time() . rand(1000, 9999) . 'thinkphp');
$insert['user_id'] = $user['user_id'];
$insert['code'] = $code;
$insert['ctime'] = time();
$this->login_auto_obj->insert($insert);
$url = 'https://submission.tmrjournals.com/per_text_fail?Art_id=' . $article_id . '&act=' . $code;
return $url;
}
/**
* 推送邮件提醒作者修回稿件
*/
@@ -123,7 +164,7 @@ class Auto extends Controller {
//查找作者信息
$cache_author = $this->user_obj->where("user_id", $v['user_id'])->find();
$tt = "Dear Dr. ".($cache_author["realname"] == "" ? $cache_author["account"] : $cache_author["realname"]).",<br>";
$tt = "Dear Dr. " . ($cache_author["realname"] == "" ? $cache_author["account"] : $cache_author["realname"]) . ",<br>";
$tt .= "We have send you the email about revision of your manuscript. According to our records you are almost reaching the deadline now. We look forward to receiving your revised article.<br><br>";
$tt .= "When preparing your revised manuscript, you are asked to carefully consider the reviewers' comments which are attached, and submit a revised versionand a list of responses to the comments before deadline. The revised parts in the manuscript should be highlighted with blue color.<br><br>";
$tt .= "If you feel that you will require more time to complete your revision, please let me know and I will update our records accordingly. If I can provide any further advice or assistance, please do not hesitate to contact me.<br><br><br>";
@@ -145,7 +186,7 @@ class Auto extends Controller {
//查找作者信息
$cache_author = $this->user_obj->where("user_id", $v['user_id'])->find();
$tt = "Dear Dr. ".($cache_author["realname"] == "" ? $cache_author["account"] : $cache_author["realname"]).",<br>";
$tt = "Dear Dr. " . ($cache_author["realname"] == "" ? $cache_author["account"] : $cache_author["realname"]) . ",<br>";
$tt .= "We have send you the email about revision of your manuscript. According to our records you are almost reaching the deadline now. We look forward to receiving your revised article.<br><br>";
$tt .= "When preparing your revised manuscript, you are asked to carefully consider the reviewers' comments which are attached, and submit a revised versionand a list of responses to the comments before deadline. The revised parts in the manuscript should be highlighted with blue color.<br><br>";
$tt .= "If you feel that you will require more time to complete your revision, please let me know and I will update our records accordingly. If I can provide any further advice or assistance, please do not hesitate to contact me.<br><br><br>";