This commit is contained in:
wangjinlei
2021-07-26 14:27:01 +08:00
parent 8ea54fdcc2
commit 3ae9be1e60
7 changed files with 163 additions and 67 deletions

View File

@@ -343,8 +343,8 @@ class Admin extends Controller {
//验证数据完整性
if ($v['username'] == '' || $v['email'] == '' || $v['realname'] == '' || $v['major'] == '' || $v['username'] == null || $v['email'] == null || $v['realname'] == null || $v['major'] == null) {
$er_data[] = [
'username' => $v['username'],
'realname' => $v['realname'],
'username' => trim($v['username']),
'realname' => trim($v['realname']),
'email' => $v['email'],
'reason' => 'Missing data'
];
@@ -354,8 +354,8 @@ class Admin extends Controller {
$major = self::get_major($v['major']);
if ($major === null) {
$er_data[] = [
'username' => $v['username'],
'realname' => $v['realname'],
'username' => trim($v['username']),
'realname' => trim($v['realname']),
'email' => $v['email'],
'reason' => 'major is error'
];
@@ -366,8 +366,8 @@ class Admin extends Controller {
$mme = self::get_userByEmail($v['email']);
if ($this_reviewer == null && $mme != null) {
$er_data[] = [
'username' => $v['username'],
'realname' => $v['realname'],
'username' => trim($v['username']),
'realname' => trim($v['realname']),
'email' => $v['email'],
'reason' => 'Email occupied,and username is:'.$mme['account']
];
@@ -384,8 +384,8 @@ class Admin extends Controller {
}
if ($this_reviewer != null && self::get_retojo($this_reviewer['user_id'], $journal) != null) {
$su_data[] = [
'username' => $v['username'],
'realname' => $v['realname'],
'username' => trim($v['username']),
'realname' => trim($v['realname']),
'email' => $v['email'],
'reason' => 'success(has register)'
];
@@ -399,7 +399,7 @@ class Admin extends Controller {
$cache_reviewer['account'] = trim($v['username']);
$cache_reviewer['password'] = md5('123456qwe');
$cache_reviewer['email'] = $v['email'];
$cache_reviewer['realname'] = $v['realname'];
$cache_reviewer['realname'] = trim($v['realname']);
$cache_reviewer['is_reviewer'] = 1;
$cache_reviewer['ctime'] = time();
$cache_id = $this->user_obj->insertGetId($cache_reviewer);
@@ -429,32 +429,37 @@ class Admin extends Controller {
//存储关系表信息
$cache_insert_rtj['reviewer_id'] = $this_reviewer == null ? $cache_id : $this_reviewer['user_id'];
$cache_insert_rtj['journal_id'] = $journal;
$cache_insert_rtj['account'] = $v['username'];
$cache_insert_rtj['account'] = trim($v['username']);
$cache_insert_rtj['journal_title'] = $journal_info['title'];
$cache_insert_rtj['ctime'] = time();
$this->reviewer_to_journal_obj->insert($cache_insert_rtj);
//增加成功信息
$su_data[] = [
'username' => $v['username'],
'realname' => $v['realname'],
'username' => trim($v['username']),
'realname' => trim($v['realname']),
'email' => $v['email'],
'reason' => 'success'
];
//发送邮件提醒审稿人
$tt = 'Dear Reviewer,<br>';
$tt .= 'In order to provide a better online experience for both authors and readers, the submission system was changed to new.<br>';
$tt .= 'Website was closed between 18:00 Aug. 2, 2020 to 24:00 Aug. 2, 2020 Beijing time.<br>';
$tt .= 'You could log in with your account in submission.tmrjournals.com .<br>';
$tt .= 'Your username:'.$v['username'].'<br>';
$tt .= 'Your password: 123456qwe (you could change your password in the system by yourself later.)<br>';
$tt .= 'Thank you so much for your kindly support.<br><br>';
$tt .= $journal_info['title'].'<br>';
$tt .= date('Y-m-d');
// $tt = 'Dear Reviewer,<br>';
// $tt .= 'In order to provide a better online experience for both authors and readers, the submission system was changed to new.<br>';
// $tt .= 'Website was closed between 18:00 Aug. 2, 2020 to 24:00 Aug. 2, 2020 Beijing time.<br>';
// $tt .= 'You could log in with your account in submission.tmrjournals.com .<br>';
// $tt .= 'Your username:'.$v['username'].'<br>';
// $tt .= 'Your password: 123456qwe (you could change your password in the system by yourself later.)<br>';
// $tt .= 'Thank you so much for your kindly support.<br><br>';
// $tt .= $journal_info['title'].'<br>';
// $tt .= date('Y-m-d');
$content = "Thank you for registering as a " . $journal_info['title'] . " reviewer<br/>". "At present, you have passed our examination<br/>";
$content .= '<a href="https://submission.tmrjournals.com">SubmissionSystem</a><br>';
$content .= '<p>username:' . trim($v['username']) . '</p>';
$content .= '<p>Original Password: 123456qwe</p>';//$has_res ? '' : '<p>password:123456qwe</p>';
$maidata['email'] = $v['email'];
$maidata['title'] = $journal_info['title'];
$maidata['content'] = $tt;
$maidata['content'] = $content;
$maidata['tmail'] = $journal_info['email'];
$maidata['tpassword'] = $journal_info['epassword'];
Queue::push( 'app\api\job\mail@fire' , $maidata , "tmail" );
@@ -605,31 +610,5 @@ class Admin extends Controller {
phpinfo();
}
public function testmail() {
$jobHandlerClassName = 'app\api\job\mail@fire';
$jobQueueName = "mail";
$data = [];
// $data['email'] = '751475802@qq.com';
$data['email'] = '13662001490@126.com';
$data['title'] = 'ttttssdsadsadsadasdss';
$tt = 'Dear Reviewer,<br>';
$tt .= 'In order to provide a better online experience for both authors and readers, the submission system was changed to new.<br>';
$tt .= 'Website was closed between 18:00 Aug. 2, 2020 to 24:00 Aug. 2, 2020 Beijing time.<br>';
$tt .= 'You could log in with your account in submission.tmrjournals.com .<br>';
$tt .= 'Your username:aaasssss<br>';
$tt .= 'Your password: 123456qwe (you could change your password in the system by yourself later.)<br>';
$tt .= 'Thank you so much for your kindly support.<br><br>';
$tt .= 'tmr<br>';
$tt .= date('Y-m-d');
$data['content'] = $tt;
$data['tmail'] = 'ghr@tmrjournals.com';
$data['tpassword'] = 'Wu999999gh';
$isPushed = Queue::push( $jobHandlerClassName , $data , $jobQueueName );
echo '<pre>';
var_dump($isPushed);
echo '</pre>';
die;
// sendEmail($v['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
}
}