Compare commits

...

2 Commits

Author SHA1 Message Date
wangjinlei
48c668b5e2 Merge remote-tracking branch 'origin/master' 2026-07-23 13:38:31 +08:00
wangjinlei
16c2d63848 价格变动后发送合适的邮件 2026-07-23 13:38:25 +08:00

View File

@@ -306,6 +306,8 @@ WHERE apa.state = ".$data['state'];
}
$apply_info = Db::name("article_price_apply")->where("id",$data['id'])->find();
$old_article_info = $this->article_obj->where("article_id",$apply_info['article_id'])->find();
$journal_info = $this->journal_obj->where("journal_id",$old_article_info['journal_id'])->find();
$article_update['fee']=$apply_info['fee'];
$article_update['fee_remark']=$apply_info['remark'];
@@ -326,6 +328,52 @@ WHERE apa.state = ".$data['state'];
}
}
//发送邮件,提醒给作者
$user_info = $this->user_obj->where("user_id",$old_article_info['user_id'])->find();
$email[] = $user_info['email'];
$authors = $this->article_author_obj->where("article_id",$apply_info['article_id'])->where("state",0)->where("is_report",1)->select();
foreach ($authors as $v){
if(in_array($v['email'],$email)){
continue;
}
$email[] = $v['email'];
}
$tt = 'Dear Authors,<br><br><br>';
$tt .= "We are pleased to inform you that your manuscript has successfully completed the editorial evaluation process and has been pre-accepted, pending the completion of the remaining publication procedures.<br><br>";
$tt .= "Manuscript Title: ".$old_article_info['title']."<br>";
$tt .= "Article SN:".$old_article_info['accept_sn']."<br><br>";
$tt .= "As part of the journal's publication support program, we are delighted to notify you that your application for an Article Processing Charge (APC) benefit has been approved.<br><br>";
$tt .= "Publication Fee Summary<br><br>";
$tt .= "Standard APC: USD $".$old_article_info['fee']."<br>";
if($apply_info['fee']==0){
$tt .= "Approved APC Benefit:Full Waiver";
}
$tt .= "Discounted APC: USD ".$apply_info['fee']."<br><br>";
$tt .= "Please note that this APC waiver/discount has been granted as a publication benefit and does not affect the journal's editorial standards. Your manuscript has been evaluated according to the same editorial and peer-review criteria applied to all submissions.<br>";
$tt .= "The Editorial Office will contact you shortly regarding the remaining publication procedures, including proofreading, copyright documentation (if applicable), and production scheduling.<br><br>";
$tt .= "Congratulations on your successful submission, and thank you for choosing Medical Data Mining. We look forward to publishing your valuable work.<br>";
$tt .= "Should you have any questions, please feel free to contact us.<br>";
$tt .= "Kind regards,<br>Editorial Office<br>".$journal_info['title'];
foreach ($email as $v){
sendEmail($v, "tmr-".$old_article_info['accept_sn']."-price approval", $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
}
//发送邮件给编辑
$editor = $this->user_obj->where("user_id",$journal_info['editor_id'])->find();
$tt = 'Dear Editor,<br><br><br>';
$tt .= "This email is to inform you of the outcome of the Article Processing Charge (APC) adjustment application for the following manuscript.<br><br>";
$tt .= "Manuscript Information<br><br>";
$tt .= "Title: ".$old_article_info['title']."<br>";
$tt .= "Article SN:".$old_article_info['accept_sn']."<br><br>";
$tt .= "APC Information<br><br>";
$tt .= "Standard APC: USD $".$old_article_info['fee']."<br>";
$tt .= "Applied APC: USD $".$apply_info['fee']."<br><br>";
$tt .= "The APC adjustment application has been approved. The manuscript will proceed with an APC of USD $".$apply_info['fee']." in accordance with the approved decision.";
sendEmail($editor['email'], "tmr-".$old_article_info['accept_sn']."-price approval", $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
return jsonSuccess();
}
@@ -353,8 +401,34 @@ WHERE apa.state = ".$data['state'];
if(!$rule->check($data)){
return jsonError($rule->getError());
}
// $apply_info = Db::name("article_price_apply")->where("id",$data['id'])->find();
$apply_info = Db::name("article_price_apply")->where("id",$data['id'])->find();
$article_info = $this->article_obj->where("article_id",$apply_info['article_id'])->find();
$journal_info = $this->journal_obj->where("journal_id",$article_info['journal_id'])->find();
Db::name("article_price_apply")->where("id",$data['id'])->update(['state'=>2,"remark"=>trim($data['remark'])]);
//发送邮件给编辑
$editor = $this->user_obj->where("user_id",$journal_info['editor_id'])->find();
$tt = 'Dear Editor,<br><br><br>';
$tt .= "This email is to inform you of the outcome of the Article Processing Charge (APC) adjustment application for the following manuscript.<br><br>";
$tt .= "Manuscript Information<br><br>";
$tt .= "Title: ".$article_info['title']."<br>";
$tt .= "Article SN:".$article_info['accept_sn']."<br><br>";
$tt .= "APC Information<br><br>";
$tt .= "Standard APC: USD $".$article_info['fee']."<br>";
$tt .= "Applied APC: USD $".$apply_info['fee']."<br><br>";
$tt .= "The APC adjustment application has been rejected.<br><br>";
$tt .= "Reason for Rejection:<br>";
$tt .= $apply_info['remark']."<br><br>";
$tt .= "No changes will be made to the publication fee, and the manuscript will remain subject to the standard APC of USD $".$article_info['fee'].".<br>";
sendEmail($editor['email'], "tmr-".$article_info['accept_sn']."-price rejected", $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
return jsonSuccess();
}