Merge remote-tracking branch 'origin/master'

This commit is contained in:
wangjinlei
2026-08-05 11:39:49 +08:00
5 changed files with 579 additions and 114 deletions

View File

@@ -474,8 +474,14 @@ class Special extends Controller
$journal_info = $this->journal_obj->where('issn', $data['journal_issn'])->find();
$check_article = $this->article_obj->where('title',$data['title'])->find();
if($check_article){
return json(['code' => 1]);
return json(['code' => 1, 'msg' => 'A manuscript with the same title already exists. Please revise the title and try again.']);
}
if(isset($data['approval']) && $data['approval']==1 &&(!isset($data['approval_file'])||!$data['approval_file'])){
return json(['code' => 1, 'msg' => 'To help us proceed with your submission, please kindly upload the ethics approval document.']);
}else if((!isset($data['approval'])||$data['approval']!=1) && (!isset($data['approval_content']) || !$data['approval_content'])){
return json(['code' => 1, 'msg' => 'If an ethics approval document is not required, please kindly provide a brief explanation.']);
}
Db::startTrans();
@@ -495,6 +501,9 @@ class Special extends Controller
$inset_data['approval'] = $data['approval'] == 'true' ? 1 : 0;
$inset_data['abstrart'] = $data['abstrart'];
$inset_data['author_act'] = 1;
if(isset($data['approval']))$inset_data['approval'] = $data['approval'];
if(isset($data['approval_file']))$inset_data['approval_file'] = $data['approval_file'];
if(isset($data['approval_content']))$inset_data['approval_content'] = $data['approval_content'];
$inset_data['ctime'] = time();
$res = $this->article_obj->insertGetId($inset_data);
@@ -512,6 +521,7 @@ class Special extends Controller
$i['department'] = $v['department'];
$i['author_title'] = $v['title'];
$i['country'] = $v['country'];
$i['orcid'] = $v['orcid'];
$i['email'] = $v['email'];
$i['address'] = $v['address'];
$i['is_super'] = $v['isSuper'] == 'true' ? 1 : 0;
@@ -598,6 +608,53 @@ class Special extends Controller
// ];
// Queue::push('app\api\job\domail@fire',$sendEditor,'domail');
$iJournalFee = empty($journal_info['fee']) ? 0 : $journal_info['fee'];
$iNowFee = intval($iJournalFee * 100);
//收费地址
$sApc = empty($journal_info['apc_url']) ? '' : $journal_info['apc_url'];
//稿件号
$sArticleSn = $inset_data['accept_sn'];
//邮件主题
$sSubject = 'Manuscript Submission Confirmation '.'['.$sArticleSn.'] '.$journal_info['title'];
if ($iNowFee > 0) {
$tt1 = 'Thank you for submitting your manuscript entitled "' . $data['title'] . '". Your submission has been assigned the following tracking number: ' . $sArticleSn . '. We will be in touch again as soon as we have reached a decision. You may check on the status of this manuscript in the Submission System. Please quote the tracking number in any communication.<br/><br/>';
$tt1 .= 'The following information was acknowledged during the submission process: '.'<i>'.$journal_info['title'].'</i>'.' is an open access journal that charges a publication fee of '.$iJournalFee.' USD for accepted manuscripts (<a href="'.$sApc.'">click here</a> for details).<br/><br/>';
$tt1 .= 'This e-mail simply acknowledges receipt of your submission. If the editors decide for editorial reasons that the paper is unsuitable for publication in '.'<i>'.$journal_info['title'].'</i>'.', you will be informed as soon as possible.<br/><br/>';
$tt1 .= 'If you encounter any problems, please contact '.$journal_info['email'].'.<br/><br/>Thank you for choosing to submit your manuscript to '.'<i>'.$journal_info['title'].'</i>'.'.<br/><br/><br/>';
$tt1 .= 'Sincerely,<br/>Editorial Office<br/>';
$tt1 .= '<i>'.$journal_info['title'].'</i>' . '<br>';
$tt1 .= 'Email: ' . $journal_info['email'] . '<br>';
$tt1 .= 'Website: ' . $journal_info['website'] . '<br>';
$tt1 .= '<hr/>If you have any questions, please contact us: <br>';
$tt1 .= 'Head of publication ethics<br>Dr. Dan Chen<br>TMR Publishing Group Limited Company, Auckland, New Zealand<br>Email: publisher@tmrjournals.com';
} else {
$tt1 = 'Thank you for submitting your manuscript entitled "' . $data['title'] . '". Your submission has been assigned the following tracking number:' . $sArticleSn . '. We will be in touch again as soon as we have reached a decision. Please quote the tracking number in any communication. This e-mail simply acknowledges receipt of your submission. If the editors decide for editorial reasons that the paper is unsuitable for publication in ' . '<i>'.$journal_info['title'].'</i>' . ', you will be informed as soon as possible.<br><br><br>';
$tt1 .= 'You may check on the status of this manuscript in the Submission System. If you encounter any problems, please contact ' . $journal_info['email'] . '.<br><br>';
$tt1 .= 'Thank you for choosing to submit your manuscript to ' . '<i>'.$journal_info['title'].'</i>' . '.<br><br><br>';
$tt1 .= 'Sincerely,<br>Editorial Office<br>';
$tt1 .= '<a href="https://www.tmrjournals.com/draw_up.html?issn=' . $journal_info['issn'] . '">Subscribe to this journal</a><br>';
$tt1 .= '<i>'.$journal_info['title'].'</i>' . '<br>';
$tt1 .= 'Email: ' . $journal_info['email'] . '<br>';
$tt1 .= 'Website: ' . $journal_info['website'] . '<br>';
$tt1 .= '<hr/>If you have any questions, please contact us: <br>';
$tt1 .= 'Head of publication ethics<br>Dr. Dan Chen<br>TMR Publishing Group Limited Company, Auckland, New Zealand<br>Email: publisher@tmrjournals.com';
}
foreach ($data['authorList'] as $v) {
$cache_str = 'Dear Dr. ' . $v['firstname'] ." ".$v['lastname'] . ',<br><br>';
$maidata['email'] = $v['email'];
$maidata['title'] = $journal_info['title'];
$maidata['content'] = $cache_str . $tt1;
$maidata['temail'] = $journal_info['email'];
$maidata['tpassword'] = $journal_info['epassword'];
//给文章作者发送邮件主题调整 20250105 start
$maidata['subject'] = empty($sSubject) ? '' : $sSubject;//邮件主题
$maidata['article_id'] = empty($res) ? 0 : $res;//文章ID
// Queue::push('app\api\job\mail@fire', $maidata, "tmail");
Queue::push('app\api\job\SendAuthorEmail@fire', $maidata, "SendAuthorEmail");
//给文章作者发送邮件主题调整 20250105 end
}
//增加用户操作log
$log_data['user_id'] = $user_res['user_id'];
$log_data['type'] = 0;
@@ -923,11 +980,21 @@ class Special extends Controller
/**
* 上传文章的文件
* coverLetter / picturesAndTables / manuscirpt 限制不超过 20M
*/
public function up_file($type)
{
$file = request()->file($type);
if ($file) {
$limitTypes = ['coverLetter', 'picturesAndTables', 'manuscirpt'];
if (in_array($type, $limitTypes, true)) {
$maxSize = 20 * 1024 * 1024;
$fileInfo = $file->getInfo();
$fileSize = isset($fileInfo['size']) ? intval($fileInfo['size']) : 0;
if ($fileSize > $maxSize) {
return json(['code' => 1, 'msg' => 'File size cannot exceed 20MB']);
}
}
$info = $file->move(ROOT_PATH . 'public' . DS . $type);
if ($info) {
return json(['code' => 0, 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
@@ -1046,7 +1113,7 @@ class Special extends Controller
$specials = isset($res['specials']) ? $res['specials'] : (isset($res['data']['specials']) ? $res['data']['specials'] : []);
foreach ($specials as $k => $v) {
unset($specials[$k]['abstract']);
$specials[$k]['icon'] = $specials[$k]['icon']?$journal_image_url."specialIcon/".$specials[$k]['icon']:"";
$specials[$k]['icon'] = $specials[$k]['icon']?$journal_image_url."journalicon/".$specials[$k]['icon']:"";
}
$re['specials'] = $specials;
$re['count'] = isset($res['data']['count']) ? intval($res['data']['count']) : 0;
@@ -2078,28 +2145,31 @@ class Special extends Controller
}
/**
* 上传专刊封面图(转发至 journal Special/up_icon_file
* 表单字段名:specialIcon
* 上传专刊封面图(转发至 journal master/Journal/up_file
* 入参表单字段兼容 specialIcon / journalicon转发官网时使用 journalicon
*/
public function up_icon_file()
{
$file = request()->file('specialIcon');
if (!$file) {
$file = request()->file('journalicon');
}
if (!$file) {
return jsonError('specialIcon is required');
}
$info = $file->getInfo();
$tmpPath = isset($info['tmp_name']) ? $info['tmp_name'] : '';
$originName = isset($info['name']) ? $info['name'] : 'specialIcon';
$originName = isset($info['name']) ? $info['name'] : 'journalicon';
$mime = isset($info['type']) && $info['type'] !== '' ? $info['type'] : 'application/octet-stream';
if ($tmpPath === '' || !is_file($tmpPath)) {
return jsonError('upload file invalid');
}
$base_url = Env::get('journal.base_url');
$url = rtrim($base_url, '/') . '/api/Special/up_icon_file';
$url = rtrim($base_url, '/') . '/master/Journal/up_file';
$postFields = [
'specialIcon' => new \CURLFile(realpath($tmpPath), $mime, $originName),
'journalicon' => new \CURLFile(realpath($tmpPath), $mime, $originName),
];
$ch = curl_init($url);
@@ -2229,5 +2299,17 @@ class Special extends Controller
return ['ok' => true, 'msg' => '', 'journal_id' => $journalId];
}
public function up_approval_file()
{
$file = request()->file('articleApproval');
if ($file) {
$info = $file->move(ROOT_PATH . 'public' . DS . 'articleApproval');
if ($info) {
return json(['code' => 0, 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
} else {
return json(['code' => 1, 'msg' => $file->getError()]);
}
}
}
}