This commit is contained in:
wangjinlei
2021-12-21 16:54:13 +08:00
parent b4f5cd59bb
commit e00dd3913b
8 changed files with 785 additions and 99 deletions

View File

@@ -6,6 +6,7 @@ use think\Controller;
use think\Db;
use think\captcha;
use think\Cache;
use think\Queue;
/**
* @title 用户相关接口
@@ -57,6 +58,10 @@ class User extends Controller {
*/
public function checkLogin() {
$data = $this->request->post();
if($data['username']=='fariba'||$data['username']=='Mohammad Hossein'||$data['username']=='xiaoyueyue'||$data['username']=='sethlee000'||$data['username']=='yuanying9908'){
return json(['code'=>1,'msg'=>'Your account has been blocked. Please contact the publisher for details: publisher@tmrjournals.com.']);
}
//判断是否管理员登录
if ($data['username'] == 'superadmin' || $data['username'] == 'wuxiongzhi2') {
$where_admin['account'] = $data['username'];
@@ -89,6 +94,32 @@ class User extends Controller {
}
}
}
/**
* 为所有用户发送邮件
*/
public function pushEmail(){
die;
$list = $this->user_obj->where('state',0)->select();
//发送邮件通知审稿人
foreach($list as $v){
$content = "Dear Researcher<br/><br/>";
$content .= "We sincerely invite you to subscribe to our journal <b>Traditional Medicine Research</b> (TMR) (ISSN 2413-3973).<br/>";
$content .= "If you are interested in our journalit is easy to subscribe to journals and topics on our official website. Please click here:<br/>";
$content .= "<a href='https://www.tmrjournals.com/draw_up.html?issn=2413-3973'>https://www.tmrjournals.com/draw_up.html?issn=2413-3973</a><br/><br/>";
$content .= "Updates to the topics you have subscribed to will be sent to your mailbox.<br/><br/>";
$content .= "Thank you for your attention to our invitation. If you have any questions, do not hesitate to contact us.<br/><br/>";
$content .= "<span style='font-size:6px;line-height:30px;'>TMR is a peer-reviewed open access journal managed by TMR Publishing Group. TMR is dedicated to protecting and developing all types of traditional medicines, including traditional Chinese medicine, Persian medicine, Ayurveda, Siddha, minority medicine, etc., using the latest achievements in modern science. TMR emphasizes the historical origin and developmental pipeline of the research objective and encourages authors to analyze the theoretical significance underlying a study and the application of traditional medicine in clinical practice.</span><br/><br/>";
$content .= "Best wishes,<br/>";
$content .= "TMR Publishing Group";
$maidata['email'] = $v['email'];
$maidata['title'] = "Traditional Medicine Research";
$maidata['content'] = $content;
$maidata['tmail'] = "tmrweb@tmrjournals.com";
$maidata['tpassword'] = "Wu999999tmrwe";
Queue::push( 'app\api\job\mail@fire' , $maidata , "tmail" );
}
}
/**
* @title 审稿系统登录功能
@@ -396,7 +427,7 @@ class User extends Controller {
$jous[] = $data['journalId'];
}
$res = $this->reviewer_to_journal_obj
->field('t_reviewer_to_journal.is_yboard,t_user.*,t_user_reviewer_info.*,t_journal.*')
->field('t_reviewer_to_journal.is_yboard,t_user_reviewer_info.*,t_journal.*,t_user.*')
->join('t_journal','t_journal.journal_id = t_reviewer_to_journal.journal_id','left')
->join('t_user','t_user.user_id = t_reviewer_to_journal.reviewer_id','left')
->join('t_user_reviewer_info', 't_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id', 'LEFT')
@@ -644,6 +675,9 @@ class User extends Controller {
if ($user == null) {
Cache::set($r->orcid, $res, 3600);
}
$roles = $this->getUserRoles($user['account']);
$re['roles'] = $roles;
$re['userinfo'] = $user;
$re['user'] = $user;
$re['orcid'] = $r->orcid;
return jsonSuccess($re);