测试修改

This commit is contained in:
chengxl
2025-11-05 09:23:32 +08:00
parent 640f3bc54c
commit 80b2ce2685

View File

@@ -3428,7 +3428,7 @@ class Article extends Base
$inset_data['abstrart'] = trim($data['abstrart']);
$inset_data['keywords'] = isset($data['keyWords']) ? $data['keyWords'] : '';
$inset_data['fund'] = isset($data['fund']) ? trim($data['fund']) : '';
$inset_data['accept_sn'] = getArticleSN($journal_info['abbr'], $data['type']);
// $inset_data['accept_sn'] = getArticleSN($journal_info['abbr'], $data['type']);
$inset_data['topics'] = isset($data["topics"]) ? json_encode($data['topics']) : "";
$inset_data['type'] = $data['type'];
// $inset_data['major_id'] = $data['major'];
@@ -3448,7 +3448,15 @@ class Article extends Base
$inset_data['state'] = -1;
$article_id = $this->article_obj->insertGetId($inset_data);
if(!empty($article_id)){
//获取accept_sn并更新
$sAcceptSn = $this->getArticleAcceptSn(['article_id' => $article_id]);
if(!empty($sAcceptSn)){
$aWhere = ['article_id' => $article_id];
$aUpdate = ['accept_sn' => $sAcceptSn];
$update_result = Db::name('article')->where($aWhere)->limit(1)->update($aUpdate);
}
}
} else {
// $checkArticle = $this->article_obj->where("article_id", "<>", $article_id)->where("title", trim($data['title']))->select();
// foreach ($checkArticle as $v) {
@@ -3663,7 +3671,7 @@ class Article extends Base
$data = $this->request->post();
$rule = new Validate([
'article_id' => 'require',
'istransfer' => 'require'
// 'istransfer' => 'require'
]);
if (!$rule->check($data)) {
return jsonError($rule->getError());
@@ -3675,12 +3683,12 @@ class Article extends Base
return jsonError('Please select the field of the article');
}
//判断是否转投
if (!isset($data['istransfer'])) {
return jsonError('Please choose to transfer to a journal');
}
if(isset($data['istransfer']) && $data['istransfer'] == 'true' && empty($data['checkedjours'])){
return jsonError('Please choose whether to transfer or not');
}
// if (!isset($data['istransfer'])) {
// return jsonError('Please choose to transfer to a journal');
// }
// if(isset($data['istransfer']) && $data['istransfer'] == 'true' && empty($data['checkedjours'])){
// return jsonError('Please choose whether to transfer or not');
// }
$article_info = $this->article_obj->where('article_id', $data['article_id'])->find();
$journal_info = $this->journal_obj->where('journal_id', $article_info['journal_id'])->find();
@@ -3692,6 +3700,13 @@ class Article extends Base
return jsonError("Your account is currently blacklisted by TMR Publishing Group. Please contact the official email of the journal you wish to submit to for further clarification.");
}
//稿件号
$sbbr = empty($journal_info['abbr']) ? '' : $journal_info['abbr'];
$sArticleType = empty($article_info['type']) ? '' : $article_info['type'];
$sArticleSn = '';
if(!empty($sbbr) && !empty($sArticleType)){
$sArticleSn = getArticleSN($sbbr, $sArticleType);
}
$author_email = [];
$authors = $this->article_author_obj->where('article_id', $data['article_id'])->where('state', 0)->select();
@@ -3736,27 +3751,27 @@ class Article extends Base
}
//增加转投信息
$transr = true;
if ($data['istransfer'] == 'true') {
foreach ($data['checkedjours'] as $val) {
$trans_insert['article_id'] = $data['article_id'];
$trans_insert['journal_id'] = $val;
$trans_insert['ctime'] = time();
$transr = $transr ? $this->article_transfer_obj->insert($trans_insert) : false;
}
}
// $transr = true;
// if ($data['istransfer'] == 'true') {
// foreach ($data['checkedjours'] as $val) {
// $trans_insert['article_id'] = $data['article_id'];
// $trans_insert['journal_id'] = $val;
// $trans_insert['ctime'] = time();
// $transr = $transr ? $this->article_transfer_obj->insert($trans_insert) : false;
// }
// }
//发送邮件到编辑,提醒有待审文章
$editor_info = $this->user_obj->where('user_id', $journal_info['editor_id'])->find();
$tt = 'Dear editor,<br>';
$tt .= 'Please check the new manuscript in the submission system.' . $article_info['accept_sn'];
$tt .= 'Please check the new manuscript in the submission system.' . $sArticleSn;
sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
$user_rev_info = $this->user_reviewer_info_obj->where("reviewer_id", $user_res['user_id'])->find();
//发送邮件给作者,表示感谢
$tt_t = 'Dear Dr. ' . ($user_res['realname'] == '' ? $user_res['account'] : $user_res['realname']) . ',<br><br>';
if ($article_info['journal_id'] == 1) {
$tt1 = 'Thank you for submitting your manuscript entitled "' . $article_info['title'] . '". Your submission has been assigned the following tracking number: ' . $article_info['accept_sn'] . '. 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 = 'Thank you for submitting your manuscript entitled "' . $article_info['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: Traditional Medicine Research is an open access journal that charges a publication fee of 600 USD for accepted manuscripts (<a href="https://www.tmrjournals.com/apc/">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 Traditional Medicine Research, you will be informed as soon as possible.<br/><br/>';
$tt1 .= 'If you encounter any problems, please contact tmr@tmrjournals.com.<br/><br/>Thank you for choosing to submit your manuscript to Traditional Medicine Research.<br/><br/><br/>';
@@ -3768,7 +3783,7 @@ class Article extends Base
$tt1 .= 'Head of publication ethics<br>Dr. Dan Chen<br>TMR Publishing Group Limited Company, Auckland, New Zealand<br>Email: publication.ethics@tmrjournals.com';
} else {
$tt1 = 'Thank you for submitting your manuscript entitled "' . $article_info['title'] . '". Your submission has been assigned the following tracking number:' . $article_info['accept_sn'] . '. 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 ' . $journal_info['title'] . ', you will be informed as soon as possible.<br><br><br>';
$tt1 = 'Thank you for submitting your manuscript entitled "' . $article_info['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 ' . $journal_info['title'] . ', 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 ' . $journal_info['title'] . '.<br><br><br>';
$tt1 .= 'Sincerely,<br>Editorial Office<br>';
@@ -3801,7 +3816,7 @@ class Article extends Base
$res_log = $this->user_log_obj->insert($log_data);
//增加usermsg
$res_msg = add_usermsg($journal_info['editor_id'], 'New manuscript sn:'.$article_info['accept_sn'], '/articleDetailEditor?id=' . $data['article_id']);
$res_msg = add_usermsg($journal_info['editor_id'], 'New manuscript sn:'.$sArticleSn, '/articleDetailEditor?id=' . $data['article_id']);
//通讯作者转为审稿人
$this->addReviewerFromArticle($data['article_id'], $journal_info['journal_id']);
@@ -3818,17 +3833,21 @@ class Article extends Base
}
//新增保存字段 chengxiaoling 20251031 start
if (isset($data['istransfer']) && $data['istransfer'] == true) {
$update_l['is_transfer'] = 1;
}
if (isset($data['istransfer']) && $data['istransfer'] == false) {
$update_l['is_transfer'] = 0;
}
// if (isset($data['istransfer']) && $data['istransfer'] == true) {
// $update_l['is_transfer'] = 1;
// }
// if (isset($data['istransfer']) && $data['istransfer'] == false) {
// $update_l['is_transfer'] = 0;
// }
if (isset($data['is_become_reviewer'])) {
$update_l['is_become_reviewer'] = $data['is_become_reviewer'];
}
if (isset($data['is_agree'])) {
$update_l['is_agree'] = $data['is_agree'];
}
if(!empty($sArticleSn)){
$update_l['accept_sn'] = $sArticleSn;
}
//新增保存字段 chengxiaoling 20251031 end
@@ -5378,20 +5397,19 @@ class Article extends Base
}
if(!empty($aAuthorData)){
foreach ($aAuthorData as $key => $value) {
if(empty($value['email']) || empty($value['author_title']) || empty($value['company']) || empty($value['firstname'])){
if(empty($value['email']) || empty($value['author_title']) || empty($value['company']) || empty($value['firstname']) || empty($value['lastname'])){
$iSecondStatus = 2;
break;
}
if($value['is_report'] == 1){
if(empty($value['address'])){
$is_report = 2;
break;
}else{
$is_report = 1;
if($is_report != 1){
if($value['is_report'] == 1 && !empty($value['orcid'])){
$is_report = 1;
}
}
if($value['is_super'] == 1){
$is_super = 1;
if($is_super != 1){
if($value['is_super'] == 1){
$is_super = 1;
}
}
}
@@ -5441,19 +5459,19 @@ class Article extends Base
$iFourStatus = 1;
$sFourMsg = '';
// if($iThreeStatus == 1){
if($aArticle['is_transfer'] == 3){//是否转投
$sFourMsg = 'Step 4: Please choose whether to transfer or not';
$iFourStatus = 2;
}
// if($aArticle['is_transfer'] == 3){//是否转投
// $sFourMsg = 'Step 4: Please choose whether to transfer or not';
// $iFourStatus = 2;
// }
if($iFourStatus == 1 && $aArticle['is_transfer'] == 1){//查询转投期刊
$aWhere = ['state' => 0, 'article_id' => $iArticleId];
$iCount = Db::name('article_transfer')->where($aWhere)->count();
if(empty($iCount)){
$sFourMsg = 'Step 4: Please choose to transfer to a journal';
$iFourStatus = 2;
}
}
// if($iFourStatus == 1 && $aArticle['is_transfer'] == 1){//查询转投期刊
// $aWhere = ['state' => 0, 'article_id' => $iArticleId];
// $iCount = Db::name('article_transfer')->where($aWhere)->count();
// if(empty($iCount)){
// $sFourMsg = 'Step 4: Please choose to transfer to a journal';
// $iFourStatus = 2;
// }
// }
//查询文章领域
if($iFourStatus == 1){
$aWhere = ['article_id' => $iArticleId,'state' => 0];
@@ -5569,8 +5587,9 @@ class Article extends Base
$aArticleInsert = ['journal_id' => $iJournalId,'title' => $sTitle,'state' => -1,'user_id' => $iUserId];
$aArticleInsert['is_use_ai'] = 3;
$aArticleInsert['is_figure_copyright'] = 3;
$aArticleInsert['is_transfer'] = 3;
// $aArticleInsert['is_transfer'] = 3;
$aArticleInsert['is_become_reviewer'] = 3;
$aArticleInsert['ctime'] = time();
$iArticleId = Db::name('article')->insertGetId($aArticleInsert);
$aParam['article_id'] = $iArticleId;
}
@@ -5596,13 +5615,13 @@ class Article extends Base
// $aUpdate['abstrart'] = $abstrart;
// }
//是否转投
$istransfer = isset($aParam['istransfer']) ? $aParam['istransfer'] : '' ;
if($istransfer == true){
$aParam['is_transfer'] = 1;
}
if($istransfer == false){
$aParam['is_transfer'] = 2;
}
// $istransfer = isset($aParam['istransfer']) ? $aParam['istransfer'] : '' ;
// if($istransfer == true){
// $aParam['is_transfer'] = 1;
// }
// if($istransfer == false){
// $aParam['is_transfer'] = 2;
// }
//是否成为审稿人
$becomeRev = isset($aParam['becomeRev']) ? $aParam['becomeRev'] : '';
if($becomeRev == true){
@@ -5611,7 +5630,7 @@ class Article extends Base
if($becomeRev == false){
$aParam['is_become_reviewer'] = 2;
}
$aField = ['is_use_ai','use_ai_explain','is_figure_copyright','is_transfer','is_become_reviewer','approval','approval_file','approval_content','code','is_transfer','is_become_reviewer','is_agree','title','abstrart','keywords','topics','fund','type','journal_id'];//,'title','abstrart','keywords','topics','fund','type'
$aField = ['is_use_ai','use_ai_explain','is_figure_copyright','is_become_reviewer','approval','approval_file','approval_content','code','is_become_reviewer','is_agree','title','abstrart','keywords','topics','fund','type','journal_id'];//,'title','abstrart','keywords','topics','fund','type','is_transfer',
$sMsg = '';
$iIsUpdate = 1;
foreach ($aField as $key => $value) {
@@ -6017,4 +6036,18 @@ class Article extends Base
$p = self::getMajorShuList($res['pid']);
return $p . ',' . $res['major_id'];
}
/**
* 生成文章sn号
*/
private function getArticleAcceptSn($aParam = [],$sFlag = 'Draft')
{
$iArticleId = empty($aParam['article_id']) ? 0 : $aParam['article_id'];
if(empty($iArticleId)){
return '';
}
$sDate = date('Y');
$sType = $sDate;
return $sFlag.$sType.str_pad($iArticleId,6,'0',STR_PAD_LEFT).rand(100,999);
}
}