This commit is contained in:
wangjinlei
2022-12-30 11:41:29 +08:00
parent a8f2c71bc0
commit dbfc3c6452
5 changed files with 177 additions and 5 deletions

View File

@@ -492,6 +492,7 @@ class Special extends Controller
//上传文章作者信息
$authors = [];
$res_add_user = true;
foreach ($data['authorList'] as $v) {
if ($v['firstname'] == '') {
continue;
@@ -508,6 +509,37 @@ class Special extends Controller
$i['is_super'] = $v['isSuper'] == 'true' ? 1 : 0;
$i['is_report'] = $v['isReport'] == 'true' ? 1 : 0;
$authors[] = $i;
//通讯作者用户添加
if($v['isReport']=="true"){
$re_user_check = $this->user_obj->where('account|email',trim($v['email']))->find();
if(!$re_user_check){
$password = getRandPassword();
$inser_data['account'] = trim($v['email']);
$inser_data['password'] = md5($password);
$inser_data['email'] = trim($v['email']);
$inser_data['realname'] = trim($v['firstname']).' '.trim($v['lastname']);
$inser_data['ctime'] = time();
$c_res_add_user=$this->user_obj->insertGetId($inser_data);
if($res_add_user){
$res_add_user = $c_res_add_user;
}
//发送提示邮件给通讯作者
$report_tt = "Dear ".$inser_data['realname'].',<br/><br/>';
$report_tt .= "We are delighted to welcome you as a new author for our journal, ".$journal_info['title'].". We have received your submission and are excited to review it for potential publication.<br/><br/>";
$report_tt .= "As a next step, we have created an account for you on our journal's website. Your account is [Username: ".trim($v['email'])." password:$password]";
$report_tt .= "and you can access your account by visiting ".$journal_info['website']." and logging in.<br/><br/>";
$report_tt .= "If you have any questions or need assistance with accessing your account, please don't hesitate to contact us. We are here to support you throughout the submission and review process.<br/><br/>";
$report_tt .= "Thank you for choosing to submit your work to our journal. We look forward to working with you.<br/><br/>";
$report_tt .= "Best regards,<br>".$inser_data['realname'].'<br/>'.$journal_info['title'];
$maidata['email'] = trim($v['email']);
$maidata['title'] = $journal_info['title'];
$maidata['content'] = $report_tt;
$maidata['tmail'] = $journal_info['email'];
$maidata['tpassword'] = $journal_info['epassword'];
Queue::push('app\api\job\mail@fire', $maidata, "tmail");
}
}
}
$res_author = $this->article_author_obj->insertAll($authors);
@@ -565,7 +597,7 @@ class Special extends Controller
//增加usermsg
$res_msg = add_usermsg($journal_info['editor_id'], 'New manuscript', '/articleDetailEditor?id=' . $res);
if ($res && $res_author && $transr && $res_file1 && $res_file2 && $res_file3 && $res_log && $res_msg) {
if ($res && $res_author && $transr &&$res_add_user && $res_file1 && $res_file2 && $res_file3 && $res_log && $res_msg) {
Db::commit();
$this->ai_scor($data['article_id']);
return json(['code' => 0]);