diff --git a/application/api/controller/Article.php b/application/api/controller/Article.php index 3206ac5..6061ea5 100644 --- a/application/api/controller/Article.php +++ b/application/api/controller/Article.php @@ -7,6 +7,7 @@ use think\Db; use think\Queue; use think\Validate; use PhpOffice\PhpWord\IOFactory; +use app\common\OpenAi; /** * @title 文章接口 @@ -22,8 +23,6 @@ class Article extends Base } - - public function refusePassword() { $data = $this->request->post(); @@ -45,7 +44,7 @@ class Article extends Base } $hashed_password = crypt($password, '$1$' . $salt . '$'); - return jsonSuccess(["result"=>$hashed_password]); + return jsonSuccess(["result" => $hashed_password]); // return $hashed_password; @@ -121,7 +120,7 @@ class Article extends Base //对于接受的文章查询后续状态 $proof_state = 0; - if ($val['state'] == 5||$val['state'] == 6) { + if ($val['state'] == 5 || $val['state'] == 6) { proofState($val['article_id']); $p_info = $this->production_article_obj->where('article_id', $val['article_id'])->where('state', 0)->find(); if ($p_info && $p_info['proof_state'] == 1) { @@ -165,7 +164,8 @@ class Article extends Base } - public function myttt(){ + public function myttt() + { $res = $this->addProductionEx("3689"); echo "
";
var_dump($res);
@@ -176,21 +176,22 @@ class Article extends Base
/**获取预接收内容状态
* @return void
*/
- public function getPreacceptStatus(){
+ public function getPreacceptStatus()
+ {
$data = $this->request->post();
$rule = new Validate([
"article_id" => "require"
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- $article_info = $this->article_obj->where('article_id',$data['article_id'])->find();
- $production_info = $this->production_article_obj->where('article_id',$article_info['article_id'])->where('state',0)->find();
+ $article_info = $this->article_obj->where('article_id', $data['article_id'])->find();
+ $production_info = $this->production_article_obj->where('article_id', $article_info['article_id'])->where('state', 0)->find();
//refer状态获取
- $refers = $this->production_article_refer_obj->where('p_article_id',$production_info['p_article_id'])->where('state',0)->select();
+ $refers = $this->production_article_refer_obj->where('p_article_id', $production_info['p_article_id'])->where('state', 0)->select();
$re_state = !(count($refers) == 0);
- foreach ($refers as $v){
- if($v['refer_doi']==""||$v['author']==""){
+ foreach ($refers as $v) {
+ if ($v['refer_doi'] == "" || $v['author'] == "") {
$re_state = false;
}
}
@@ -205,31 +206,32 @@ class Article extends Base
/**接收文章
* @return void
*/
- public function articleAccept(){
+ public function articleAccept()
+ {
$data = $this->request->post();
$rule = new Validate([
- "article_id"=>"require"
+ "article_id" => "require"
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- $article_info = $this->article_obj->where("article_id",$data['article_id'])->find();
- if($article_info['is_buy']==0){
+ $article_info = $this->article_obj->where("article_id", $data['article_id'])->find();
+ if ($article_info['is_buy'] == 0) {
return jsonError("Unpaid");
}
- $journal_info = $this->journal_obj->where("journal_id",$article_info['journal_id'])->find();
- $user_info = $this->user_obj->where('user_id',$article_info['user_id'])->find();
- $editor_info = $this->user_obj->where('user_id',$article_info['editor_id'])->find();
+ $journal_info = $this->journal_obj->where("journal_id", $article_info['journal_id'])->find();
+ $user_info = $this->user_obj->where('user_id', $article_info['user_id'])->find();
+ $editor_info = $this->user_obj->where('user_id', $article_info['editor_id'])->find();
//接收后为用户增加积分
- if ($journal_info['level'] == 'A') {
- $score = 1;
- } elseif ($journal_info['level'] == 'B') {
- $score = 0.5;
- } else {
- $score = 0.3;
- }
- addUserScoreLog($user_info['user_id'], $score, "add score " . $score . " for submit article :" . $article_info['accept_sn'], time());
- $this->user_obj->where('user_id', $user_info['user_id'])->setInc('score', $score);
+ if ($journal_info['level'] == 'A') {
+ $score = 1;
+ } elseif ($journal_info['level'] == 'B') {
+ $score = 0.5;
+ } else {
+ $score = 0.3;
+ }
+ addUserScoreLog($user_info['user_id'], $score, "add score " . $score . " for submit article :" . $article_info['accept_sn'], time());
+ $this->user_obj->where('user_id', $user_info['user_id'])->setInc('score', $score);
//添加文章状态信息(如果状态未更新可做通话用,并结束操作)
$insert_data['article_id'] = $data['article_id'];
$insert_data['state_from'] = $article_info['state'];
@@ -241,7 +243,7 @@ class Article extends Base
$update_data['state'] = 5;
$update_data['rtime'] = time();
$update_data['editor_act'] = 1;
- $this->article_obj->where("article_id",$data['article_id'])->update($update_data);
+ $this->article_obj->where("article_id", $data['article_id'])->update($update_data);
//拒稿或者录用 - 发送审稿意见
$this->sendEmailToReviewer($data['article_id'], 5);
@@ -272,8 +274,6 @@ class Article extends Base
}
-
-
/**
* @title 获取文章列表(编辑)
* @description 获取文章列表(编辑)
@@ -347,9 +347,9 @@ class Article extends Base
//查询AI审核内容 chengxiaoling 20250328 start
$aAiReview = array();
- if(!empty($res)){
+ if (!empty($res)) {
$aArticleId = array_column($res, 'article_id');
- $aAiReview = Db::table('t_article_ai_review')->field('article_id,content')->whereIn('article_id',$aArticleId)->column('article_id,content');
+ $aAiReview = Db::table('t_article_ai_review')->field('article_id,content')->whereIn('article_id', $aArticleId)->column('article_id,content');
}
//查询AI审核内容 chengxiaoling 20250328 end
@@ -358,18 +358,18 @@ class Article extends Base
$cache_review = $this->article_reviewer_obj
->field("t_article_reviewer.*,t_article_reviewer_question.rated,t_user.realname")
->join("t_article_reviewer_question", "t_article_reviewer_question.art_rev_id = t_article_reviewer.art_rev_id", 'left')
- ->join("t_user","t_user.user_id = t_article_reviewer.reviewer_id","left")
+ ->join("t_user", "t_user.user_id = t_article_reviewer.reviewer_id", "left")
->where("t_article_reviewer.article_id", $val['article_id'])
->where("t_article_reviewer.state", 'in', [0, 1, 2, 3])
->select();
//添加复审信息
- foreach ($cache_review as $k => $v){
- $repeat = $this->article_reviewer_repeat_obj->where('art_rev_id',$v['art_rev_id'])->select();
- if($repeat){
- $last = count($repeat)-1;
- $cache_review[$k]['can_repeat'] = ($repeat[$last]['state']==1&&$repeat[$last]['recommend']==3)?1:0;
+ foreach ($cache_review as $k => $v) {
+ $repeat = $this->article_reviewer_repeat_obj->where('art_rev_id', $v['art_rev_id'])->select();
+ if ($repeat) {
+ $last = count($repeat) - 1;
+ $cache_review[$k]['can_repeat'] = ($repeat[$last]['state'] == 1 && $repeat[$last]['recommend'] == 3) ? 1 : 0;
$cache_review[$k]['repeat'] = $repeat;
- }else{//不存在复审实例,可添加
+ } else {//不存在复审实例,可添加
$cache_review[$k]['can_repeat'] = 1;
$cache_review[$k]['repeat'] = [];
}
@@ -398,7 +398,7 @@ class Article extends Base
//添加国家信息
foreach ($res as $k => $v) {
- $cache_author_list = $this->article_author_obj->where('article_id', $v['article_id'])->where("state",0)->select();
+ $cache_author_list = $this->article_author_obj->where('article_id', $v['article_id'])->where("state", 0)->select();
$cache_country = [];
foreach ($cache_author_list as $key => $val) {
if ($val['country'] != '' && !in_array($val['country'], $cache_country)) {
@@ -510,14 +510,14 @@ class Article extends Base
// ->where('t_article_reviewer.article_id', $article_res['article_id'])
// ->select();
- $suggest = $this->article_reviewer_obj->where("state","in",[1,2,3])->where('article_id',$article_res['article_id'])->select();
+ $suggest = $this->article_reviewer_obj->where("state", "in", [1, 2, 3])->where('article_id', $article_res['article_id'])->select();
- foreach ($suggest as $k => $v){
+ foreach ($suggest as $k => $v) {
$fr = [];
- $c = $this->article_reviewer_question_obj->where('art_rev_id',$v['art_rev_id'])->find();
+ $c = $this->article_reviewer_question_obj->where('art_rev_id', $v['art_rev_id'])->find();
$fr[] = $c;
- $f = $this->article_reviewer_repeat_obj->where('art_rev_id',$v['art_rev_id'])->select();
- foreach ($f as $val){
+ $f = $this->article_reviewer_repeat_obj->where('art_rev_id', $v['art_rev_id'])->select();
+ foreach ($f as $val) {
$fr[] = $val;
}
$suggest[$k]['question'] = $fr;
@@ -528,8 +528,8 @@ class Article extends Base
// $suggest[$k]['repeats'] = $ca;
// }
$major = $this->getMajorStr($article_res['major_id']);
- $majors = $this->major_to_article_obj->where("article_id",$data['articleId'])->where("state",0)->select();
- foreach ($majors as $k => $v){
+ $majors = $this->major_to_article_obj->where("article_id", $data['articleId'])->where("state", 0)->select();
+ foreach ($majors as $k => $v) {
$majors[$k]["major"] = getMajorShu($v['major_id']);
$majors[$k]['str'] = getMajorStr($v['major_id']);
}
@@ -552,7 +552,7 @@ class Article extends Base
$up_data['editor_act'] = 0;
}
$this->article_obj->where('article_id', $data['articleId'])->update($up_data);
- return json(['article' => $article_res, 'msg' => $article_msg, 'authors' => $author_res, 'suggest' => $suggest, 'transfer' => $transfer_res, 'transinfo' => $transfer_info,"major"=>$major]);
+ return json(['article' => $article_res, 'msg' => $article_msg, 'authors' => $author_res, 'suggest' => $suggest, 'transfer' => $transfer_res, 'transinfo' => $transfer_info, "major" => $major]);
}
@@ -629,7 +629,7 @@ class Article extends Base
//判断简介字符串长度是否不低于200 chengxiaoling 20250327 start
- if(!$this->checkMinChars($data['abstrart'],200)){
+ if (!$this->checkMinChars($data['abstrart'], 200)) {
return jsonError("The abstract should not be less than 200 Chinese characters or English words!");
}
//判断简介字符串长度是否不低于200 chengxiaoling 20250327 end
@@ -748,49 +748,50 @@ class Article extends Base
/**获取关联作者的信息
* @return \think\response\Json|void
*/
- public function getRelationAuthor(){
+ public function getRelationAuthor()
+ {
$data = $this->request->post();
$rule = new Validate([
- "user_id"=>"require"
+ "user_id" => "require"
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- $user_info = $this->user_obj->where("user_id",$data['user_id'])->find();
- $authors = $this->article_obj->field("t_article_author.*")->join("t_article_author","t_article_author.article_id = t_article.article_id","left")
- ->where("t_article.user_id",$data['user_id'])->where("t_article_author.state",0)
+ $user_info = $this->user_obj->where("user_id", $data['user_id'])->find();
+ $authors = $this->article_obj->field("t_article_author.*")->join("t_article_author", "t_article_author.article_id = t_article.article_id", "left")
+ ->where("t_article.user_id", $data['user_id'])->where("t_article_author.state", 0)
->order("t_article_author.email,t_article_author.art_aut_id")->select();
$cache_author = [];
- foreach ($authors as $k=>$v){
- if(!isset($v['email'])||$v['email']==""){
+ foreach ($authors as $k => $v) {
+ if (!isset($v['email']) || $v['email'] == "") {
continue;
}
$cache_author[$v['email']][] = $v;
}
$authors = [];
- foreach ($cache_author as $k => $v){
+ foreach ($cache_author as $k => $v) {
$c = [];
$c['email'] = $k;
- foreach ($v as $value){
- if($value['firstname']!=""){
+ foreach ($v as $value) {
+ if ($value['firstname'] != "") {
$c['firstname'] = $value['firstname'];
}
- if($value['lastname']!=""){
+ if ($value['lastname'] != "") {
$c['lastname'] = $value['lastname'];
}
- if($value['company']!=""){
+ if ($value['company'] != "") {
$c['company'] = $value['company'];
}
- if($value['department']!=""){
+ if ($value['department'] != "") {
$c['department'] = $value['department'];
}
- if($value['author_title']!=""){
+ if ($value['author_title'] != "") {
$c['author_title'] = $value['author_title'];
}
- if($value['country']!=""){
+ if ($value['country'] != "") {
$c['country'] = $value['country'];
}
- if($value['address']!=""){
+ if ($value['address'] != "") {
$c['address'] = $value['address'];
}
}
@@ -804,47 +805,48 @@ class Article extends Base
/**通过邮件地址获取相关作者信息
* @return void
*/
- public function getRelationAuthorByEmail(){
+ public function getRelationAuthorByEmail()
+ {
$data = $this->request->post();
$rule = new Validate([
- "email"=>"require",
- "page"=>"require",
- "limit"=>"require"
+ "email" => "require",
+ "page" => "require",
+ "limit" => "require"
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- $es = explode("@",$data['email']);
- if($es==""){
+ $es = explode("@", $data['email']);
+ if ($es == "") {
return jsonError("Email error");
}
- $emails = $this->article_author_obj->field("email")->where("email","like","%".$data['email']."%")->where('state',0)->group("email")->page($data['page'],$data['limit'])->select();
- $count = $this->article_author_obj->field("email")->where("email","like","%".$data['email']."%")->where('state',0)->group("email")->count();
+ $emails = $this->article_author_obj->field("email")->where("email", "like", "%" . $data['email'] . "%")->where('state', 0)->group("email")->page($data['page'], $data['limit'])->select();
+ $count = $this->article_author_obj->field("email")->where("email", "like", "%" . $data['email'] . "%")->where('state', 0)->group("email")->count();
$authors = [];
- foreach ($emails as $v){
+ foreach ($emails as $v) {
$c = [];
$c['email'] = $v['email'];
- $cl = $this->article_author_obj->where("email",$v['email'])->where('state',0)->select();
- foreach ($cl as $value){
- if($value['firstname']!=""){
+ $cl = $this->article_author_obj->where("email", $v['email'])->where('state', 0)->select();
+ foreach ($cl as $value) {
+ if ($value['firstname'] != "") {
$c['firstname'] = $value['firstname'];
}
- if($value['lastname']!=""){
+ if ($value['lastname'] != "") {
$c['lastname'] = $value['lastname'];
}
- if($value['company']!=""){
+ if ($value['company'] != "") {
$c['company'] = $value['company'];
}
- if($value['department']!=""){
+ if ($value['department'] != "") {
$c['department'] = $value['department'];
}
- if($value['author_title']!=""){
+ if ($value['author_title'] != "") {
$c['author_title'] = $value['author_title'];
}
- if($value['country']!=""){
+ if ($value['country'] != "") {
$c['country'] = $value['country'];
}
- if($value['address']!=""){
+ if ($value['address'] != "") {
$c['address'] = $value['address'];
}
}
@@ -898,10 +900,10 @@ class Article extends Base
{
$data = $this->request->post();
$rule = new Validate([
- "username"=>"require",
- "articleId"=>"require"
+ "username" => "require",
+ "articleId" => "require"
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
$username = $data['username'];
@@ -929,7 +931,7 @@ class Article extends Base
//发送邮件
$editor_info = $this->user_obj->where('user_id', $journal_info['editor_id'])->find();
$tt = 'Dear editor,
';
- $tt .= 'The author has repair, please check.
';
+ $tt .= 'The author has repair, please check. SN:'.$article_info['accept_sn'].'
';
$tt .= 'TMR Publishing Group';
sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
@@ -1067,22 +1069,23 @@ class Article extends Base
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
- public function getArticlesByArticle(){
+ public function getArticlesByArticle()
+ {
$data = $this->request->post();
$rule = new Validate([
"article_id" => "require"
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- $article_info = $this->article_obj->where('article_id',$data['article_id'])->find();
- $list = $this->article_obj->field("t_article.*,t_journal.title journal_title")->join("t_journal","t_journal.journal_id = t_article.journal_id","left")->where("t_article.user_id",$article_info['user_id'])->select();
+ $article_info = $this->article_obj->where('article_id', $data['article_id'])->find();
+ $list = $this->article_obj->field("t_article.*,t_journal.title journal_title")->join("t_journal", "t_journal.journal_id = t_article.journal_id", "left")->where("t_article.user_id", $article_info['user_id'])->select();
$re['user_articles'] = $list;
- $authors = $this->article_author_obj->where('article_id',$data['article_id'])->where('state',0)->select();
- foreach ($authors as $k => $v){
- if($v['email']!=""&&$v['email']!="empty"){
- $as = $this->article_obj->field("t_article.*,t_journal.title journal_title")->join("t_article_author","t_article.article_id = t_article_author.article_id","left")->join("t_journal","t_journal.journal_id = t_article.journal_id","left")->where("t_article.article_id","<>",$data['article_id'])->where("t_article_author.state",0)->where("t_article_author.email",$v['email'])->select();
- }else{
+ $authors = $this->article_author_obj->where('article_id', $data['article_id'])->where('state', 0)->select();
+ foreach ($authors as $k => $v) {
+ if ($v['email'] != "" && $v['email'] != "empty") {
+ $as = $this->article_obj->field("t_article.*,t_journal.title journal_title")->join("t_article_author", "t_article.article_id = t_article_author.article_id", "left")->join("t_journal", "t_journal.journal_id = t_article.journal_id", "left")->where("t_article.article_id", "<>", $data['article_id'])->where("t_article_author.state", 0)->where("t_article_author.email", $v['email'])->select();
+ } else {
$as = null;
}
$authors[$k]["articles"] = $as;
@@ -1159,19 +1162,20 @@ class Article extends Base
}
- public function checkArticleStart(){
+ public function checkArticleStart()
+ {
$data = $this->request->post();
$rule = new Validate([
"article_id" => "require"
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- $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();
- if($article_info['scoring'] < $journal_info['kfen']){
- return jsonError("The initial review score for ".$journal_info['title']." is ".$journal_info['kfen'].". The current article's initial review score is ".$article_info['scoring'].", and the manuscript will be automatically rejected while it is in the with editor status.");
- }else{
+ $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();
+ if ($article_info['scoring'] < $journal_info['kfen']) {
+ return jsonError("The initial review score for " . $journal_info['title'] . " is " . $journal_info['kfen'] . ". The current article's initial review score is " . $article_info['scoring'] . ", and the manuscript will be automatically rejected while it is in the with editor status.");
+ } else {
return jsonSuccess([]);
}
}
@@ -1232,7 +1236,7 @@ class Article extends Base
// }
//初审分数不够,自动拒稿
- if ($article_info['state'] == 0 &&$data['state']!=0&& $article_info['type'] != 'N' && $article_info['type'] != 'T') {
+ if ($article_info['state'] == 0 && $data['state'] != 0 && $article_info['type'] != 'N' && $article_info['type'] != 'T') {
// if (($journal_info['journal_id'] == 1 && $article_info['scoring'] < 4) || (($journal_info['journal_id'] == 10 || $journal_info['journal_id'] == 23) && $article_info['scoring'] < 3) || ($journal_info['journal_id'] == 21 && $article_info['scoring'] < 0) || (($journal_info['journal_id'] == 16||$journal_info['journal_id'] == 6||$journal_info['journal_id'] == 12) && $article_info['scoring'] < 2) || ($journal_info['journal_id'] != 1 && $journal_info['journal_id'] != 6 && $journal_info['journal_id'] != 16 && $journal_info['journal_id'] != 12 && $journal_info['journal_id'] != 10 && $journal_info['journal_id'] != 21 && $journal_info['journal_id'] != 23 && $article_info['scoring'] < 1)) {
if ($article_info['scoring'] < $journal_info['kfen']) {//触发拒稿
if (count($transfer_list) > 0) {//如果有共同投稿
@@ -1260,9 +1264,9 @@ class Article extends Base
$tt .= 'journal:' . $journal_info['title'] . '
';
$tt .= 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',
';
- $tt .= "Thank you for submitting your manuscript to ".$journal_info['title'].". After a thorough initial review by our editorial team, we regret to inform you that we are unable to move forwardwith your submission for further consideration.
";
+ $tt .= "Thank you for submitting your manuscript to " . $journal_info['title'] . ". After a thorough initial review by our editorial team, we regret to inform you that we are unable to move forwardwith your submission for further consideration.
";
$tt .= "Please know that this decision was made with careful deliberation,and we appreciate the effort and time you have invested in yourresearch. We encourage you to consider submitting your work to a journal that may be a better fit for your manuscript.
";
- $tt .= "We sincerely thank you for considering ".$journal_info['title']." as a venue for your work, and we hope this outcome does not deter you fromsubmitting future manuscripts to our journal.
";
+ $tt .= "We sincerely thank you for considering " . $journal_info['title'] . " as a venue for your work, and we hope this outcome does not deter you fromsubmitting future manuscripts to our journal.
";
// $tt .= 'Thank you for submitting your paper to ' . $journal_info['title'] . '. Your manuscript has undergone review.
';
// $tt .= 'Unfortunately the editors feel that ' . $journal_info['title'] . ' is not the appropriate venue for your manuscript. You munuscript will transfer to journal - ' . $tran_journal['title'] . ' as you co-submitting chose order.If you have questions about the Co-submission process, please contact publisher@tmrjournals.com within 48 hours.
Yours sincerely,
';
$tt .= "Sincerely,
";
@@ -1388,7 +1392,7 @@ class Article extends Base
}
}
}
- if ($rev_real_num < 2&&$rev_real_num>count($rev_list_t)) {
+ if ($rev_real_num < 2 && $rev_real_num > count($rev_list_t)) {
return json(['code' => 1, 'msg' => "Before proceeding to the next step, you need more than two available reviewer comments, and the total number of accept is greater than the total number of rejected."]);
}
}
@@ -1397,7 +1401,7 @@ class Article extends Base
return jsonError("Submissions with a repetition rate greater than thirty percent will not be accepted");
}
//预接收有时间限定必须大于14天
- if($data["state"]==6&&($article_info['ctime']+3600*24*14)>time()){
+ if ($data["state"] == 6 && ($article_info['ctime'] + 3600 * 24 * 14) > time()) {
return jsonError("The receiving time must be greater than 14 days");
}
@@ -1450,13 +1454,13 @@ class Article extends Base
}
//为预接收的文章生成production实例
- if($data['state'] == 6){
+ if ($data['state'] == 6) {
// $this->addProductionEx($data['articleId']);
$this->addArticleMainEx($data['articleId']);
//如果是免费的期刊文章,那么直接变成付款完成
- if($journal_info['fee']==0||$article_info['ctime']<1735660800){
- $this->article_obj->where("article_id",$article_info['article_id'])->update(["is_buy"=>1]);
+ if ($journal_info['fee'] == 0 || $article_info['ctime'] < 1735660800) {
+ $this->article_obj->where("article_id", $article_info['article_id'])->update(["is_buy" => 1]);
}
}
}
@@ -1465,24 +1469,24 @@ class Article extends Base
if ($data['state'] == 3) { //拒稿
if ($data['trsjournal'] == 0) {
//直接拒稿
- $review_msg_has = $this->article_msg_obj->where("article_id",$article_info['article_id'])->where("state_to",2)->find();
- $tx_msg_has = $this->article_msg_obj->where("article_id",$article_info['article_id'])->where("state_to",4)->find();
- if($review_msg_has&&$tx_msg_has){
+ $review_msg_has = $this->article_msg_obj->where("article_id", $article_info['article_id'])->where("state_to", 2)->find();
+ $tx_msg_has = $this->article_msg_obj->where("article_id", $article_info['article_id'])->where("state_to", 4)->find();
+ if ($review_msg_has && $tx_msg_has) {
$tt = 'Dear Dr. ' . ($user_info['realname'] == "" ? $user_info['account'] : $user_info['realname']) . '
';
- $tt .= "Thank you for submitting your manuscript to ".$journal_info['title'].". We appreciate the time and effort you invested in revising your manuscript in response to the reviewers' comments.
";
+ $tt .= "Thank you for submitting your manuscript to " . $journal_info['title'] . ". We appreciate the time and effort you invested in revising your manuscript in response to the reviewers' comments.
";
$tt .= "After a thorough evaluation of the revised manuscript, including further feedback from our external reviewers, we regret to inform you that your manuscript has not been accepted for publication in our journal. While your revisions addressed many of the reviewers' concerns, there remain significant issues that prevent us from moving forward with publication.
";
$tt .= "We recognize that this decision is disappointing, especially given the effort you have put into this work. We encourage you to consider the reviewers' feedback as you continue to develop your manuscript for submission to another journal.
";
- $tt .= "Thank you for considering ".$journal_info['title']." for your research. We wish you success in your future academic endeavors and hope that you will consider us again for future submissions.
";
+ $tt .= "Thank you for considering " . $journal_info['title'] . " for your research. We wish you success in your future academic endeavors and hope that you will consider us again for future submissions.
";
$tt .= "Sincerely,
";
$tt .= 'Editorial Office
';
- }elseif ($review_msg_has){
+ } elseif ($review_msg_has) {
$tt = 'Dear Dr. ' . ($user_info['realname'] == "" ? $user_info['account'] : $user_info['realname']) . '
';
- $tt .= "Thank you for submitting your manuscript to ".$journal_info['title'].". After a thorough initial review by our editorial team, we regret to inform you that we are unable to move forwardwith your submission for further consideration.
";
+ $tt .= "Thank you for submitting your manuscript to " . $journal_info['title'] . ". After a thorough initial review by our editorial team, we regret to inform you that we are unable to move forwardwith your submission for further consideration.
";
$tt .= "Please know that this decision was made with careful deliberation,and we appreciate the effort and time you have invested in yourresearch. We encourage you to consider submitting your work to a journal that may be a better fit for your manuscript.
";
- $tt .= "We sincerely thank you for considering ".$journal_info['title']." as a platform for your work, and we hope this outcome does not deter you from submitting future manuscripts to our journal.
";
+ $tt .= "We sincerely thank you for considering " . $journal_info['title'] . " as a platform for your work, and we hope this outcome does not deter you from submitting future manuscripts to our journal.
";
$tt .= "Sincerely,
";
$tt .= 'Editorial Office
';
- }else{
+ } else {
$tt = '"' . $article_info['title'] . '"
';
$tt .= $article_info['accept_sn'] . '
';
$tt .= 'journal:' . $journal_info['title'] . '
';
@@ -1536,15 +1540,15 @@ class Article extends Base
} else if ($data['state'] == 6) { //终审
// $tt = 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',
';
// $tt .= 'Manuscript status: Your manuscript "' . $article_info['title'] . '" is under reviewing by editorial member team of ' . $journal_info['title'] . '.';
- $tt = $article_info['accept_sn']."——".$article_info['title']."
";
+ $tt = $article_info['accept_sn'] . "——" . $article_info['title'] . "
";
$tt .= 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',
';
- $tt .= "We are delighted to inform you that your manuscript titled ".$article_info['title']." has been pre-accepted for publication in ".$journal_info['title'].". Congratulations!
";
+ $tt .= "We are delighted to inform you that your manuscript titled " . $article_info['title'] . " has been pre-accepted for publication in " . $journal_info['title'] . ". Congratulations!
";
$tt .= 'As per our publication requirements, as well as to ensure a smooth publication process, we kindly request you to log in to the "Author Center" and follow the instructions provided to complete the necessary information for your manuscript.
';
$tt .= "Please find below the steps to access your pre-accepted manuscript:
";
$tt .= "1. Please log in using your credentials at https://submission.tmrjournals.com.
";
$tt .= "2. Please find your pre-accepted manuscript list in the menu “My Manuscript” on the left.
";
$tt .= "3. Please click on the “Enter Pre-accept Process” to proceed.
";
- $tt .= "If you encounter any difficulties or have any questions, please do not hesitate to contact our editorial team at ".$journal_info['title'].". Welcome your new excellent work!
";
+ $tt .= "If you encounter any difficulties or have any questions, please do not hesitate to contact our editorial team at " . $journal_info['title'] . ". Welcome your new excellent work!
";
} else {
$tt = '"' . $article_info['title'] . '"
';
$tt .= $article_info['accept_sn'] . '
';
@@ -1559,8 +1563,8 @@ class Article extends Base
sendEmail($user_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword'], ROOT_PATH . 'public' . DS . 'system' . DS . 'Checklist_new.docx');
//给通讯作者也要发送
- $authors = $this->article_author_obj->where("article_id",$article_info['article_id'])->where("state",0)->where("is_report",1)->select();
- foreach ($authors as $vv){
+ $authors = $this->article_author_obj->where("article_id", $article_info['article_id'])->where("state", 0)->where("is_report", 1)->select();
+ foreach ($authors as $vv) {
sendEmail($vv['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword'], ROOT_PATH . 'public' . DS . 'system' . DS . 'Checklist_new.docx');
}
@@ -1608,23 +1612,23 @@ class Article extends Base
//增加usermsg
add_usermsg($article_info['user_id'], 'Your manuscript has new process: ' . $article_info['title'], '/articleDetail?id=' . $article_info['article_id']);
- //文章状态修改为送审中时触发自动推荐审稿人 chengxiaoling 20250617 start
+ //文章状态修改为送审中时触发自动推荐审稿人 chengxiaoling 20250617 start
if ($data['state'] == 2) {
$iArticleId = empty($article_info['article_id']) ? 0 : $article_info['article_id'];
- if(!empty($iArticleId)){
+ if (!empty($iArticleId)) {
$iSeconds = 180;//3分钟后执行
- Queue::later($iSeconds,'app\api\job\RecommendReviewer@fire',['article_id' =>$iArticleId], 'RecommendReviewer');
- }
+ Queue::later($iSeconds, 'app\api\job\RecommendReviewer@fire', ['article_id' => $iArticleId], 'RecommendReviewer');
+ }
}
//文章状态修改为送审中时触发自动推荐审稿人 chengxiaoling 20250617 end
//文章状态修改为退修状态 给同意审稿但一直未审稿人发送邮件且扣减其分数值 chengxiaoling 20250617 start
if ($data['state'] == 4) {
$iArticleId = empty($article_info['article_id']) ? 0 : $article_info['article_id'];
- if(!empty($iArticleId)){
+ if (!empty($iArticleId)) {
$iSeconds = 180;//三分钟后执行
- Queue::later($iSeconds,'app\api\job\RevisionReviewer@fire',['article_id' =>$iArticleId], 'RevisionReviewer');
- }
+ Queue::later($iSeconds, 'app\api\job\RevisionReviewer@fire', ['article_id' => $iArticleId], 'RevisionReviewer');
+ }
}
//文章状态修改为退修状态 给同意审稿但一直未审稿人发送邮件且扣减其分数值 chengxiaoling 20250617 end
@@ -1751,7 +1755,7 @@ class Article extends Base
->join("t_journal", "t_journal.issn = t_major_to_journal.journal_issn", "left")
->where("t_major_to_journal.major_id", $data['major_id'])
->where('t_major_to_journal.mtj_state', 0)
- ->where("t_journal.state",0)
+ ->where("t_journal.state", 0)
->select();
$re['journals'] = $list;
@@ -1974,7 +1978,7 @@ class Article extends Base
// add_usermsg($data['uid'], 'You have new manuscript to be approved', '/reviewerArticleDetail?id=' . $res);
// return json(['code' => 0]);
// }
- public function addArticleReviewer()
+ public function addArticleReviewer()
{
//接收参数,查询数据
$data = $this->request->post();
@@ -1985,8 +1989,8 @@ class Article extends Base
$reviewer_info = $this->user_obj->where('user_id', $data['uid'])->find();
$reviewer_move = $this->user_reviewer_info_obj->where("reviewer_info_id", $reviewer_info['user_id'])->find();
//排除自己审自己
- $check_self = $this->article_author_obj->where("email",$reviewer_info['email'])->where("article_id",$article_info['article_id'])->where("state",0)->find();
- if($check_self){
+ $check_self = $this->article_author_obj->where("email", $reviewer_info['email'])->where("article_id", $article_info['article_id'])->where("state", 0)->find();
+ if ($check_self) {
return jsonError("Notice:Selected reviewers may be the authors for this paper!");
}
@@ -1997,7 +2001,7 @@ class Article extends Base
return jsonError("Invitation record already exists!");
}
- if($article_info['state']==0){
+ if ($article_info['state'] == 0) {
return jsonError("The article can only be added in state with editor at least");
}
@@ -2029,7 +2033,7 @@ class Article extends Base
. ' be most grateful if you could offer an opinion regarding its suitability for publication'
. ' in the journal ' . $journal_info['title'] . '.
';
$tt .= 'Abstract of the Manuscript:
';
- $tt .= ''. $article_info['abstrart'] .'
';
+ $tt .= '' . $article_info['abstrart'] . '
';
$tt .= 'Please let us know if there are any potential conflicts of interest. If you agree to review this manuscript, we kindly request that you complete and submit your review through the submission system within 14 days of receiving the manuscript.
';
$tt .= 'Click here to accept the invitation to review
';
$tt .= 'Click here to decline the invitation to review
';
@@ -2045,10 +2049,10 @@ class Article extends Base
//内容加头尾
$pre = \think\Env::get('emailtemplete.pre');
$net = \think\Env::get('emailtemplete.net');
- $net1 = str_replace("{{email}}",trim($reviewer_info['email']),$net);
- $tt=$pre.$tt.$net1;
+ $net1 = str_replace("{{email}}", trim($reviewer_info['email']), $net);
+ $tt = $pre . $tt . $net1;
- $email_title = "Invitation to review a manuscript for ".$journal_info['title']."-[".$article_info['accept_sn']."]";
+ $email_title = "Invitation to review a manuscript for " . $journal_info['title'] . "-[" . $article_info['accept_sn'] . "]";
sendEmail($reviewer_info['email'], $email_title, $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
//记录userlog
@@ -2103,23 +2107,23 @@ class Article extends Base
// }
-
- public function addArticleTable(){
+ public function addArticleTable()
+ {
$data = $this->request->post();
$rule = new Validate([
- "article_id"=>"require",
- "list"=>"require"
+ "article_id" => "require",
+ "list" => "require"
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- foreach ($data['list'] as $v){
+ foreach ($data['list'] as $v) {
$insert['article_id'] = $data['article_id'];
- if($v['type']==0){
+ if ($v['type'] == 0) {
$insert['table'] = $v['table'];
$insert['html_data'] = $v['html_data'];
$insert['type'] = 0;
- }else{
+ } else {
$insert['type'] = 1;
$insert['url'] = $v['url'];
}
@@ -2130,39 +2134,42 @@ class Article extends Base
}
- public function reloadArticleTable(){
+ public function reloadArticleTable()
+ {
$data = $this->request->post();
$rule = new Validate([
- "article_id"=>"require"
+ "article_id" => "require"
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- $this->article_table_obj->where("article_id",$data['article_id'])->update(['state'=>1]);
+ $this->article_table_obj->where("article_id", $data['article_id'])->update(['state' => 1]);
return jsonSuccess([]);
}
- public function getArticleTable(){
+ public function getArticleTable()
+ {
$data = $this->request->post();
$rule = new Validate([
- "article_id"=>"require"
+ "article_id" => "require"
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- $tables = $this->article_table_obj->where("article_id",$data['article_id'])->where("state",0)->select();
+ $tables = $this->article_table_obj->where("article_id", $data['article_id'])->where("state", 0)->select();
$re['list'] = $tables;
return jsonSuccess($re);
}
- public function myMarkTmage(){
+ public function myMarkTmage()
+ {
$data = $this->request->post();
$rule = new Validate([
- "article_id"=>"require"
+ "article_id" => "require"
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
$this->markArticleImage($data['article_id']);
@@ -2172,25 +2179,26 @@ class Article extends Base
/**分解文章的图片和表格
* @return void
*/
- private function markArticleImage($article_id){
+ private function markArticleImage($article_id)
+ {
// $article_info = $this->article_obj->where("article_id",$article_id)->find();
//处理word的图片内容
- $files = $this->article_file_obj->where("article_id",$article_id)->where("type_name","manuscirpt")->where("state",0)->order("ctime desc")->limit(1)->select();
+ $files = $this->article_file_obj->where("article_id", $article_id)->where("type_name", "manuscirpt")->where("state", 0)->order("ctime desc")->limit(1)->select();
$file = '';
- if(isset($files[0])){
+ if (isset($files[0])) {
$file = $files[0]['file_url'];
}
- $dir = ROOT_PATH."public/articleImage/".$article_id;
+ $dir = ROOT_PATH . "public/articleImage/" . $article_id;
if (!is_dir($dir)) {
mkdir($dir, 0777, true);
}
- $this->markWord("https://submission.tmrjournals.com/public/".$file,$article_id);
+ $this->markWord("https://submission.tmrjournals.com/public/" . $file, $article_id);
//处理压缩包等等的内容
- $pics = $this->article_file_obj->where("article_id",$article_id)->where("type_name","picturesAndTables")->where("state",0)->order("file_id desc")->limit(1)->select();
- foreach ($pics as $v){
+ $pics = $this->article_file_obj->where("article_id", $article_id)->where("type_name", "picturesAndTables")->where("state", 0)->order("file_id desc")->limit(1)->select();
+ foreach ($pics as $v) {
$extension = pathinfo($v['file_url'], PATHINFO_EXTENSION);
- if($extension=="zip"){
- $this->markZip(ROOT_PATH."public/".$v['file_url'],$article_id);
+ if ($extension == "zip") {
+ $this->markZip(ROOT_PATH . "public/" . $v['file_url'], $article_id);
}
}
return jsonSuccess([]);
@@ -2312,15 +2320,14 @@ class Article extends Base
private function insertImageData($article_id, $newFileName)
{
- $ff="";
- if(pathinfo($newFileName,PATHINFO_EXTENSION)=="tif"||pathinfo($newFileName,PATHINFO_EXTENSION)=="tiff"){
+ $ff = "";
+ if (pathinfo($newFileName, PATHINFO_EXTENSION) == "tif" || pathinfo($newFileName, PATHINFO_EXTENSION) == "tiff") {
$ff = $this->crossTifToPng($article_id . "/" . $newFileName);
- }else{
+ } else {
$ff = $article_id . "/" . $newFileName;
}
-
$insert = [
'article_id' => $article_id,
'image' => $ff,
@@ -2401,20 +2408,21 @@ class Article extends Base
$this->markWord("https://submission.tmrjournals.com/public/articleCache/" . $article_id . "/" . $word_file, $article_id);
}
- private function markWord($file,$article_id){
- $url = $this->ts_base_url."api/typeset/markImages";
+ private function markWord($file, $article_id)
+ {
+ $url = $this->ts_base_url . "api/typeset/markImages";
$program['file'] = $file;
$program['article_id'] = $article_id;
$res = object_to_array(json_decode(myPost($url, $program)));
- if(!isset($res['data']['list'])){
- return ;
+ if (!isset($res['data']['list'])) {
+ return;
}
$file_runs = $res['data']['list'];
- foreach ($file_runs as $v){
+ foreach ($file_runs as $v) {
$insert['article_id'] = $article_id;
- $insert['image'] = $article_id."/".$v;
- if(pathinfo($v,PATHINFO_EXTENSION)=="tif"||pathinfo($v,PATHINFO_EXTENSION)=="tiff"){
+ $insert['image'] = $article_id . "/" . $v;
+ if (pathinfo($v, PATHINFO_EXTENSION) == "tif" || pathinfo($v, PATHINFO_EXTENSION) == "tiff") {
$insert['jpg_url'] = $this->crossTifToPng($article_id . "/" . $v);
}
$insert['ctime'] = time();
@@ -2436,34 +2444,36 @@ class Article extends Base
// }
- public function getArticleImages(){
+ public function getArticleImages()
+ {
$data = $this->request->post();
$rule = new Validate([
- "article_id"=>"require"
+ "article_id" => "require"
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- $check = $this->article_image_obj->where("article_id",$data['article_id'])->where("state",0)->find();
- if(!$check){
+ $check = $this->article_image_obj->where("article_id", $data['article_id'])->where("state", 0)->find();
+ if (!$check) {
$this->markArticleImage($data['article_id']);
}
- $list = $this->article_image_obj->where("article_id",$data['article_id'])->where("state",0)->select();
+ $list = $this->article_image_obj->where("article_id", $data['article_id'])->where("state", 0)->select();
$re['list'] = $list;
return jsonSuccess($re);
}
- public function reloadArticleImages(){
+ public function reloadArticleImages()
+ {
$data = $this->request->post();
$rule = new Validate([
- "article_id"=>"require"
+ "article_id" => "require"
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- $dir = ROOT_PATH."public".DS."articleImage".DS.$data['article_id'];
+ $dir = ROOT_PATH . "public" . DS . "articleImage" . DS . $data['article_id'];
if (is_dir($dir)) {
$files = scandir($dir);
foreach ($files as $file) {
@@ -2478,37 +2488,39 @@ class Article extends Base
}
}
//清除数据库数据
- $this->article_image_obj->where("article_id",$data['article_id'])->update(['state'=>1]);
+ $this->article_image_obj->where("article_id", $data['article_id'])->update(['state' => 1]);
//重新获取
$this->markArticleImage($data['article_id']);
return jsonSuccess([]);
}
- public function getArticleTables(){
+ public function getArticleTables()
+ {
$data = $this->request->post();
$rule = new Validate([
- "article_id"=>"require"
+ "article_id" => "require"
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- $list = $this->article_table_obj->where("article_id",$data['article_id'])->where("state",0)->select();
+ $list = $this->article_table_obj->where("article_id", $data['article_id'])->where("state", 0)->select();
$re['list'] = $list;
return jsonSuccess($re);
}
- public function addArticleTable1(){
+ public function addArticleTable1()
+ {
$data = $this->request->post();
$rule = new Validate([
- "article_id"=>"require",
- "list"=>"require"
+ "article_id" => "require",
+ "list" => "require"
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- foreach ($data['list'] as $v){
+ foreach ($data['list'] as $v) {
$insert['article_id'] = $data['article_id'];
$insert['table'] = $v['table'];
$insert['type'] = 0;
@@ -2541,8 +2553,6 @@ class Article extends Base
// }
-
-
/**
* 编辑添加审稿实例(临时开启,为了补充审稿实例不够)
*/
@@ -2815,51 +2825,53 @@ class Article extends Base
/**添加作者
* @return void
*/
- public function addAuthor(){
+ public function addAuthor()
+ {
$data = $this->request->post();
$rule = new Validate([
- "article_id"=>"require",
- "firstname"=>"require",
- "lastname"=>"require",
- "email"=>"require",
- "country"=>"require",
- "isSuper"=>"require",
- "isReport"=>"require"
+ "article_id" => "require",
+ "firstname" => "require",
+ "lastname" => "require",
+ "email" => "require",
+ "country" => "require",
+ "isSuper" => "require",
+ "isReport" => "require"
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- $max = $this->article_author_obj->where("article_id",$data['article_id'])->where("state",0)->max("sort");
+ $max = $this->article_author_obj->where("article_id", $data['article_id'])->where("state", 0)->max("sort");
$insert['article_id'] = $data['article_id'];
- $insert['sort'] = $max+1;
+ $insert['sort'] = $max + 1;
$insert['firstname'] = trim($data['firstname']);
$insert['lastname'] = trim($data['lastname']);
$insert['email'] = trim($data['email']);
$insert['country'] = trim($data['country']);
$insert['is_super'] = $data['isSuper'] == 'true' ? 1 : 0;
$insert['is_report'] = $data['isReport'] == 'true' ? 1 : 0;
- $insert['author_title'] = isset($data['title'])?trim($data["title"]):"";
- $insert['company'] = isset($data['company'])?trim($data['company']):"";
- $insert['department'] = isset($data['department'])?trim($data['department']):"";
- $insert['address'] = isset($data['address'])?trim($data['address']):"";
+ $insert['author_title'] = isset($data['title']) ? trim($data["title"]) : "";
+ $insert['company'] = isset($data['company']) ? trim($data['company']) : "";
+ $insert['department'] = isset($data['department']) ? trim($data['department']) : "";
+ $insert['address'] = isset($data['address']) ? trim($data['address']) : "";
$this->article_author_obj->insert($insert);
return jsonSuccess([]);
}
- public function editAuthor(){
+ public function editAuthor()
+ {
$data = $this->request->post();
$rule = new Validate([
- "art_aut_id"=>"require",
- "article_id"=>"require",
- "firstname"=>"require",
- "lastname"=>"require",
- "email"=>"require",
- "country"=>"require",
- "isSuper"=>"require",
- "isReport"=>"require",
- "title"=>"require"
+ "art_aut_id" => "require",
+ "article_id" => "require",
+ "firstname" => "require",
+ "lastname" => "require",
+ "email" => "require",
+ "country" => "require",
+ "isSuper" => "require",
+ "isReport" => "require",
+ "title" => "require"
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
$insert['article_id'] = $data['article_id'];
@@ -2870,25 +2882,26 @@ class Article extends Base
$insert['is_super'] = $data['isSuper'] == 'true' ? 1 : 0;
$insert['is_report'] = $data['isReport'] == 'true' ? 1 : 0;
$insert['author_title'] = trim($data["title"]);
- $insert['company'] = isset($data['company'])?trim($data['company']):"";
- $insert['department'] = isset($data['department'])?trim($data['department']):"";
- $insert['address'] = isset($data['address'])?trim($data['address']):"";
- $this->article_author_obj->where("art_aut_id",$data['art_aut_id'])->update($insert);
+ $insert['company'] = isset($data['company']) ? trim($data['company']) : "";
+ $insert['department'] = isset($data['department']) ? trim($data['department']) : "";
+ $insert['address'] = isset($data['address']) ? trim($data['address']) : "";
+ $this->article_author_obj->where("art_aut_id", $data['art_aut_id'])->update($insert);
return jsonSuccess([]);
}
/**
* @return void
*/
- public function getAuthors(){
+ public function getAuthors()
+ {
$data = $this->request->post();
$rule = new Validate([
- "article_id"=>"require"
+ "article_id" => "require"
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- $authors = $this->article_author_obj->where("article_id",$data["article_id"])->where("state",0)->order("sort")->select();
+ $authors = $this->article_author_obj->where("article_id", $data["article_id"])->where("state", 0)->order("sort")->select();
$re['authors'] = $authors;
return jsonSuccess($re);
}
@@ -2896,66 +2909,67 @@ class Article extends Base
/**上调文章作者顺序
* @return void
*/
- public function upAuthors(){
+ public function upAuthors()
+ {
$data = $this->request->post();
$rule = new Validate([
- "art_aut_id"=>"require"
+ "art_aut_id" => "require"
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- $info = $this->article_author_obj->where("art_aut_id",$data['art_aut_id'])->find();
- if($info['sort']<2){
+ $info = $this->article_author_obj->where("art_aut_id", $data['art_aut_id'])->find();
+ if ($info['sort'] < 2) {
return jsonError("fail");
}
- $info_1 = $this->article_author_obj->where("article_id",$info['article_id'])->where("state",0)->where("sort",$info['sort']-1)->find();
- $this->article_author_obj->where("art_aut_id",$info['art_aut_id'])->setDec("sort");
- $this->article_author_obj->where("art_aut_id",$info_1['art_aut_id'])->setInc("sort");
+ $info_1 = $this->article_author_obj->where("article_id", $info['article_id'])->where("state", 0)->where("sort", $info['sort'] - 1)->find();
+ $this->article_author_obj->where("art_aut_id", $info['art_aut_id'])->setDec("sort");
+ $this->article_author_obj->where("art_aut_id", $info_1['art_aut_id'])->setInc("sort");
return jsonSuccess([]);
}
/**下调文章作者顺序
* @return \think\response\Json|void
*/
- public function downAuthors(){
+ public function downAuthors()
+ {
$data = $this->request->post();
$rule = new Validate([
- "art_aut_id"=>"require"
+ "art_aut_id" => "require"
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- $info = $this->article_author_obj->where("art_aut_id",$data['art_aut_id'])->find();
- $info_1 = $this->article_author_obj->where("article_id",$info['article_id'])->where("state",0)->where("sort",$info['sort']+1)->find();
- if($info_1==null){
+ $info = $this->article_author_obj->where("art_aut_id", $data['art_aut_id'])->find();
+ $info_1 = $this->article_author_obj->where("article_id", $info['article_id'])->where("state", 0)->where("sort", $info['sort'] + 1)->find();
+ if ($info_1 == null) {
return jsonError("fail");
}
- $this->article_author_obj->where("art_aut_id",$info['art_aut_id'])->setInc("sort");
- $this->article_author_obj->where("art_aut_id",$info_1['art_aut_id'])->setDec("sort");
+ $this->article_author_obj->where("art_aut_id", $info['art_aut_id'])->setInc("sort");
+ $this->article_author_obj->where("art_aut_id", $info_1['art_aut_id'])->setDec("sort");
return jsonSuccess([]);
}
/**
* @return void
*/
- public function delAuthor(){
+ public function delAuthor()
+ {
$data = $this->request->post();
$rule = new Validate([
- "art_aut_id"=>"require"
+ "art_aut_id" => "require"
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- $info = $this->article_author_obj->where("art_aut_id",$data['art_aut_id'])->find();
+ $info = $this->article_author_obj->where("art_aut_id", $data['art_aut_id'])->find();
//大于此条的sort都减一
- $this->article_author_obj->where("article_id",$info['article_id'])->where("sort",">",$info['sort'])->setDec("sort");
- $this->article_author_obj->where("art_aut_id",$data['art_aut_id'])->update(['state'=>1]);
+ $this->article_author_obj->where("article_id", $info['article_id'])->where("sort", ">", $info['sort'])->setDec("sort");
+ $this->article_author_obj->where("art_aut_id", $data['art_aut_id'])->update(['state' => 1]);
return jsonSuccess([]);
}
-
-
/**
* 获取已暂存的文章列表
*/
@@ -3002,8 +3016,8 @@ class Article extends Base
// } else {
// $major = $major_info;
// }
- $majors = $this->major_to_article_obj->where("article_id",$data['article_id'])->where("state",0)->select();
- foreach ($majors as $k => $v){
+ $majors = $this->major_to_article_obj->where("article_id", $data['article_id'])->where("state", 0)->select();
+ foreach ($majors as $k => $v) {
$majors[$k]["major"] = getMajorShu($v['major_id']);
}
$authors = $this->article_author_obj->where('article_id', $data['article_id'])->where('state', 0)->select();
@@ -3017,22 +3031,23 @@ class Article extends Base
}
- public function changeJournal(){
+ public function changeJournal()
+ {
$data = $this->request->post();
$rule = new Validate([
- "article_id"=>"require",
- "journal_id"=>"require"
+ "article_id" => "require",
+ "journal_id" => "require"
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- $article_info = $this->article_obj->where("article_id",$data['article_id'])->find();
- $journal_info = $this->journal_obj->where("journal_id",$data['journal_id'])->find();
- if(!$article_info){
+ $article_info = $this->article_obj->where("article_id", $data['article_id'])->find();
+ $journal_info = $this->journal_obj->where("journal_id", $data['journal_id'])->find();
+ if (!$article_info) {
return jsonError("The article has not been submitted yet");
}
$sn = getArticleSN($journal_info['abbr'], $article_info['type']);
- $this->article_obj->where("article_id",$data['article_id'])->update(['journal_id'=>$data['journal_id'],"accept_sn"=>$sn]);
+ $this->article_obj->where("article_id", $data['article_id'])->update(['journal_id' => $data['journal_id'], "accept_sn" => $sn]);
return jsonSuccess([]);
}
@@ -3054,8 +3069,8 @@ class Article extends Base
if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- //判断简介字符串长度是否不低于200 chengxiaoling 20250327 start
- if(!$this->checkMinChars($data['abstrart'],200)){
+ //判断简介字符串长度是否不低于200 chengxiaoling 20250327 start
+ if (!$this->checkMinChars($data['abstrart'], 200)) {
return jsonError("The abstract should not be less than 200 Chinese characters or English words!");
}
//判断简介字符串长度是否不低于200 chengxiaoling 20250327 end
@@ -3063,7 +3078,7 @@ class Article extends Base
$user_info = $this->user_obj->where('user_id', $data['user_id'])->find();
$journal_info = $this->journal_obj->where('journal_id', $data['journal'])->find();
- if($journal_info['state']==1){
+ if ($journal_info['state'] == 1) {
return jsonError("Submission failed");
}
$article_id = $data['article_id'];
@@ -3089,12 +3104,12 @@ class Article extends Base
// $inset_data['major_id'] = $data['major'];
//处理伦理
- if(isset($data['approval'])&&$data['approval']==1){
+ if (isset($data['approval']) && $data['approval'] == 1) {
$inset_data['approval'] = 1;
- $inset_data['approval_file'] = isset($data["approval_file"])?$data["approval_file"]:'';
- }else{
+ $inset_data['approval_file'] = isset($data["approval_file"]) ? $data["approval_file"] : '';
+ } else {
$inset_data["approval"] = 0;
- $inset_data['approval_content'] = isset($data["approval_content"])?$data["approval_content"]:'';
+ $inset_data['approval_content'] = isset($data["approval_content"]) ? $data["approval_content"] : '';
}
$inset_data['ctime'] = time();
@@ -3119,26 +3134,27 @@ class Article extends Base
$up['type'] = $data['type'];
// $up['major_id'] = $data['major'];
//处理伦理
- if(isset($data['approval'])&&$data['approval']==1){
+ if (isset($data['approval']) && $data['approval'] == 1) {
$up['approval'] = 1;
- $up['approval_file'] = isset($data["approval_file"])?$data["approval_file"]:'';
- }else{
+ $up['approval_file'] = isset($data["approval_file"]) ? $data["approval_file"] : '';
+ } else {
$up["approval"] = 0;
- $up['approval_content'] = isset($data["approval_content"])?$data["approval_content"]:'';//trim($data['approval_content']);
+ $up['approval_content'] = isset($data["approval_content"]) ? $data["approval_content"] : '';//trim($data['approval_content']);
}
$this->article_obj->where('article_id', $article_id)->update($up);
}
- changeArticleMajor($article_id,$data['major']);
+ changeArticleMajor($article_id, $data['major']);
return jsonSuccess(['article_id' => $article_id]);
}
-
- public function mytest(){
- changeArticleMajor(5774,"97");
+ public function mytest()
+ {
+ changeArticleMajor(5774, "97");
}
+
/**获取期刊话题
* @return void
*/
@@ -3304,8 +3320,8 @@ class Article extends Base
$user_res = $this->user_obj->where('user_id', $article_info['user_id'])->find();
//验证是否在黑名单
- $black = $this->user_black_obj->where('user_id',$user_res['user_id'])->where('black_state',0)->find();
- if($black){
+ $black = $this->user_black_obj->where('user_id', $user_res['user_id'])->where('black_state', 0)->find();
+ if ($black) {
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.");
}
@@ -3345,7 +3361,7 @@ class Article extends Base
$maidata['content'] = $report_tt;
$maidata['tmail'] = $journal_info['email'];
$maidata['tpassword'] = $journal_info['epassword'];
- if(trim($v['email'])!==$user_res['email']){
+ if (trim($v['email']) !== $user_res['email']) {
Queue::push('app\api\job\mail@fire', $maidata, "tmail");
}
}
@@ -3366,13 +3382,13 @@ class Article extends Base
//发送邮件到编辑,提醒有待审文章
$editor_info = $this->user_obj->where('user_id', $journal_info['editor_id'])->find();
$tt = 'Dear editor,
';
- $tt .= 'Please check the new manuscript in the submission system.'.$article_info['accept_sn'];
+ $tt .= 'Please check the new manuscript in the submission system.' . $article_info['accept_sn'];
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']) . ',
';
- if($article_info['journal_id']==1){
+ 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.
';
$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 (click here for details).
';
$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.
';
@@ -3384,7 +3400,7 @@ class Article extends Base
$tt1 .= '
If you have any questions, please contact us:
';
$tt1 .= 'Head of publication ethics
Dr. Dan Chen
TMR Publishing Group Limited Company, Auckland, New Zealand
Email: publication.ethics@tmrjournals.com';
- }else{
+ } 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.
';
$tt1 .= 'You may check on the status of this manuscript in the Submission System. If you encounter any problems, please contact ' . $journal_info['email'] . '.
';
$tt1 .= 'Thank you for choosing to submit your manuscript to ' . $journal_info['title'] . '.
';
@@ -3398,7 +3414,6 @@ class Article extends Base
}
-
sendEmail($user_res['email'], $journal_info['title'], $journal_info['title'], $tt_t . $tt1, $journal_info['email'], $journal_info['epassword']);
foreach ($author_email as $v) {
@@ -3493,12 +3508,13 @@ class Article extends Base
/**刷新评分
* @return void
*/
- public function refuseScore(){
+ public function refuseScore()
+ {
$data = $this->request->post();
$rule = new Validate([
- "article_id"=>'require'
+ "article_id" => 'require'
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
$this->ai_scor($data['article_id']);
@@ -3524,22 +3540,22 @@ class Article extends Base
foreach ($authors as $v) {
//获取H指数的值,wos为第一,scopus为第二,google为第三
$c_user = $this->user_obj->where('email', $v['email'])->find();
- if($c_user['wos_index']>$c_user['scopus_index']){//采用wos
- if($g_index<$c_user['wos_index']){
+ if ($c_user['wos_index'] > $c_user['scopus_index']) {//采用wos
+ if ($g_index < $c_user['wos_index']) {
$g_index = $c_user['wos_index'];
}
- }else{
- if($c_user['scopus_index']>0){//采用scopus
- if($g_index<$c_user['scopus_index']){
+ } else {
+ if ($c_user['scopus_index'] > 0) {//采用scopus
+ if ($g_index < $c_user['scopus_index']) {
$g_index = $c_user['scopus_index'];
}
- }else{//采用google或者为空
- if($c_user['google_index']>0){
- if($g_index<$c_user['google_index']){
+ } else {//采用google或者为空
+ if ($c_user['google_index'] > 0) {
+ if ($g_index < $c_user['google_index']) {
$g_index = $c_user['google_index'];
}
- }else{//全部为空
- if ($c_user['google_time']>0||$c_user['wos_time']>0||$c_user['scopus_time']>0) {//应对h指数为0的用户文章,先取是否填写过h指数为0的情况
+ } else {//全部为空
+ if ($c_user['google_time'] > 0 || $c_user['wos_time'] > 0 || $c_user['scopus_time'] > 0) {//应对h指数为0的用户文章,先取是否填写过h指数为0的情况
$google_time++;
}
@@ -3560,9 +3576,9 @@ class Article extends Base
// $h_fen = 0;
if ($g_index >= 20) {
$h_fen = 4;
- }elseif ($g_index >= 12){
+ } elseif ($g_index >= 12) {
$h_fen = 3;
- }elseif ($g_index >= 6) {
+ } elseif ($g_index >= 6) {
$h_fen = 2;
} elseif ($g_index >= 2) {
$h_fen = 1;
@@ -3573,7 +3589,7 @@ class Article extends Base
//图表
$b_fen = 0;
$p_num = 0;
- $url = $this->ts_base_url."api/typeset/readPic";
+ $url = $this->ts_base_url . "api/typeset/readPic";
$program['fileRoute'] = "https://submission.tmrjournals.com/public/" . $files[0]['file_url'];
$res = object_to_array(json_decode(myPost($url, $program)));
$wp = isset($res['data']['pic']) ? $res['data']['pic'] : 0;
@@ -3593,42 +3609,41 @@ class Article extends Base
$p_num = $wp > $np ? $wp : $np;
$all_num = $p_num + $tp;
- if($article_info['type']=="A"){
- if($all_num>=5){
+ if ($article_info['type'] == "A") {
+ if ($all_num >= 5) {
$b_fen = 2;
- }elseif ($all_num>=4){
+ } elseif ($all_num >= 4) {
$b_fen = 1.5;
- }elseif ($all_num>=2){
+ } elseif ($all_num >= 2) {
$b_fen = 1;
- }elseif ($all_num>=1){
+ } elseif ($all_num >= 1) {
$b_fen = 0.5;
- }else{
+ } else {
$b_fen = 0;
}
- }elseif($article_info['type']=="B"){
- if ($all_num>=4){
+ } elseif ($article_info['type'] == "B") {
+ if ($all_num >= 4) {
$b_fen = 2;
- }elseif ($all_num>=3){
+ } elseif ($all_num >= 3) {
$b_fen = 1.5;
- }elseif ($all_num>=2){
+ } elseif ($all_num >= 2) {
$b_fen = 1;
- }elseif($all_num>=1){
+ } elseif ($all_num >= 1) {
$b_fen = 0.5;
- }else{
+ } else {
$b_fen = 0;
}
- }else{
- if($all_num>=2){
+ } else {
+ if ($all_num >= 2) {
$b_fen = 2;
- }elseif($all_num>=1){
+ } elseif ($all_num >= 1) {
$b_fen = 1;
- }else{
+ } else {
$b_fen = 0;
}
}
-
// $all_num = $p_num + $tp;
// if ($all_num > 3) {
// $b_fen = 2;
@@ -3641,42 +3656,42 @@ class Article extends Base
//当h指数为0 并且是编辑填写的
if ($h_fen == 0 && $google_time > 0) {
- if($article_info['type']=="A"){
- if($all_num>=6){
+ if ($article_info['type'] == "A") {
+ if ($all_num >= 6) {
$b_fen = 4;
- }elseif ($all_num>=5){
+ } elseif ($all_num >= 5) {
$b_fen = 3;
- }elseif ($all_num>=4){
+ } elseif ($all_num >= 4) {
$b_fen = 2.5;
- }elseif ($all_num>=3){
+ } elseif ($all_num >= 3) {
$b_fen = 2;
- }elseif ($all_num>=2){
+ } elseif ($all_num >= 2) {
$b_fen = 1;
- }elseif ($all_num>=1){
+ } elseif ($all_num >= 1) {
$b_fen = 0.5;
- }else{
+ } else {
$b_fen = 0;
}
- }elseif ($article_info['type']=="B"){
- if ($all_num>=5){
+ } elseif ($article_info['type'] == "B") {
+ if ($all_num >= 5) {
$b_fen = 4;
- }elseif ($all_num>=4){
+ } elseif ($all_num >= 4) {
$b_fen = 3;
- }elseif ($all_num>=3){
+ } elseif ($all_num >= 3) {
$b_fen = 2;
- }elseif ($all_num>=2){
+ } elseif ($all_num >= 2) {
$b_fen = 1;
- }elseif ($all_num>=1){
+ } elseif ($all_num >= 1) {
$b_fen = 0.5;
- }else{
+ } else {
$b_fen = 0;
}
- }else{
- if($all_num>=2){
+ } else {
+ if ($all_num >= 2) {
$b_fen = 4;
- }elseif($all_num>=1){
+ } elseif ($all_num >= 1) {
$b_fen = 2;
- }else{
+ } else {
$b_fen = 0;
}
}
@@ -3755,18 +3770,18 @@ class Article extends Base
}
//单位
$dw_fen = 0;
- $dw_authors = $this->article_author_obj->where("article_id",$article_id)->where("state",0)->select();
- foreach ($dw_authors as $v){
- $ca_res = $this->company_top_obj->where('title', $v['company'])->find();
- if ($ca_res) {
- if ($ca_res['company_id'] <= 100 || ($ca_res['company_id'] > 201 && $ca_res['company_id'] <= 301)) {
- $dw_fen = 1.5;
- } else {
- if($dw_fen<1.5){
- $dw_fen = 1;
- }
+ $dw_authors = $this->article_author_obj->where("article_id", $article_id)->where("state", 0)->select();
+ foreach ($dw_authors as $v) {
+ $ca_res = $this->company_top_obj->where('title', $v['company'])->find();
+ if ($ca_res) {
+ if ($ca_res['company_id'] <= 100 || ($ca_res['company_id'] > 201 && $ca_res['company_id'] <= 301)) {
+ $dw_fen = 1.5;
+ } else {
+ if ($dw_fen < 1.5) {
+ $dw_fen = 1;
}
}
+ }
}
$fen += $dw_fen;
@@ -3799,6 +3814,14 @@ class Article extends Base
$jj_fen = 0.5;
$fen += 0.5;
}
+
+ //对于以往文章的投递情况加分
+ $history_fen = $this->historyFen($article_id);
+ if($history_fen>0){
+ $fen += $history_fen;
+ }
+
+
// return $fen;
$updata['scoring'] = $fen;
$updata['h_fen'] = $h_fen;
@@ -3812,6 +3835,61 @@ class Article extends Base
return jsonSuccess([]);
}
+
+
+
+ public function hf_test(){
+ $data = $this->request->post();
+ $rule = new Validate([
+ "article_id"=>"require"
+ ]);
+ if(!$rule->check($data)){
+ return jsonError($rule->getError());
+ }
+ echo $this::historyFen($data['article_id']);
+ }
+
+
+ private function historyFen($article_id){
+ $es = $this->article_author_obj->where("article_id",$article_id)->where("is_report",1)->where("state",0)->column("email");
+ $authors = $this->article_author_obj
+ ->field("t_article.*")
+ ->join("t_article","t_article.article_id = t_article_author.article_id","left")
+ ->whereIn("t_article_author.email",$es)
+ ->where("t_article_author.is_report",1)
+ ->where("t_article_author.article_id","<>",$article_id)
+ ->where("t_article_author.state",0)
+ ->where("t_article.ctime",">",strtotime("-3 years"))
+ ->group("t_article_author.article_id")
+ ->select();
+ if(count($authors)==0){
+ return 0;
+ }elseif (count($authors)==1){
+ if($authors[0]['ctime']0.8){
+ return 0.5;
+ }elseif ($fl>0.7){
+ return 0.4;
+ }elseif ($fl>0.6){
+ return 0.3;
+ }else{
+ return 0.2;
+ }
+ }
+ }
+
private function readZip($file)
{
$zip = new \ZipArchive();
@@ -3823,8 +3901,6 @@ class Article extends Base
}
-
-
/**
* 添加推荐审稿人
*/
@@ -4035,6 +4111,17 @@ class Article extends Base
$insert['ftype'] = 1;
$insert['ctime'] = time();
$this->article_msg_obj->insert($insert);
+
+ $article_info = $this->article_obj->where("article_id",$data['articleId'])->find();
+ $journal_info = $this->journal_obj->where("journal_id",$article_info['journal_id'])->find();
+
+ $editor_info = $this->user_obj->where('user_id', $journal_info['editor_id'])->find();
+ $tt = 'Dear editor,
';
+ $tt .= 'The author sent a new message, please check. SN:'.$article_info['accept_sn'].'
';
+ $tt .= 'TMR Publishing Group';
+ sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
+
+
return json(['code' => 0]);
}
@@ -4095,7 +4182,8 @@ class Article extends Base
}
}
- public function up_approval_file(){
+ public function up_approval_file()
+ {
$file = request()->file('articleApproval');
if ($file) {
$info = $file->move(ROOT_PATH . 'public' . DS . 'articleApproval');
@@ -4209,15 +4297,16 @@ class Article extends Base
return json($res);
}
- public function getJournalByAbbr(){
+ public function getJournalByAbbr()
+ {
$data = $this->request->post();
$rule = new Validate([
- "abbr"=>"require"
+ "abbr" => "require"
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- $journal_info = $this->journal_obj->where("abbr",$data['abbr'])->find();
+ $journal_info = $this->journal_obj->where("abbr", $data['abbr'])->find();
$re['detail'] = $journal_info;
return jsonSuccess($re);
}
@@ -4376,7 +4465,7 @@ class Article extends Base
$res = $this->user_obj->where('user_id', $user_id)->find();
if ($res['type'] == 1) { // 作者 - 修改author_act,并发送给编辑发邮件
$this->article_obj->where('article_id', $article_id)->update(['author_act' => 1]);
- $journal_info = $this->journal_obj->where("journal_id",$article['journal_id'])->find();
+ $journal_info = $this->journal_obj->where("journal_id", $article['journal_id'])->find();
$editor = $this->user_obj->where('user_id', $journal_info['editor_id'])->find();
// 发邮件
$content = 'Dear editor,
please check the new feedback.';
@@ -4418,62 +4507,65 @@ class Article extends Base
* @param $num 字符长度
* @return void
*/
- private function checkMinChars($str = '',$num = 200) {
+ private function checkMinChars($str = '', $num = 200)
+ {
// 过滤非汉字和英文的字符(保留汉字、大小写字母)
$filteredStr = preg_replace('/[^\x{4e00}-\x{9fa5}a-zA-Z0-9]/u', '', $str);
-
+
// 计算有效字符总数(汉字按1个字符计,英文和数字同理)
$total = mb_strlen($filteredStr, 'UTF-8');
return $total >= $num;
}
+
/**
* 审稿人审稿质量
* @param $article_id 文章ID
* @return void
*/
- private function reviewQuality($article_id = ''){
+ private function reviewQuality($article_id = '')
+ {
$article_id = empty($article_id) ? $this->request->post('article_id') : $article_id;
- if(empty($article_id)){
- return json(['status' => 2,'msg' => '请选择要查询的文章']);
+ if (empty($article_id)) {
+ return json(['status' => 2, 'msg' => '请选择要查询的文章']);
}
//查询文章状态
$aWhere = [
- 'article_id'=>$article_id,
- 'state'=>['in',[3,5]]
+ 'article_id' => $article_id,
+ 'state' => ['in', [3, 5]]
];
$aArticle = Db::name('article')->field('article_id,state')->where($aWhere)->find();
- if(empty($aArticle)){
- return json(['status' => 1,'msg' => '暂无数据']);
+ if (empty($aArticle)) {
+ return json(['status' => 1, 'msg' => '暂无数据']);
}
//获取该文章审核人的信息
$aWhere = [
- 'article_id'=>$aArticle['article_id'],
- 'state'=>['in',[1,2,3]]
+ 'article_id' => $aArticle['article_id'],
+ 'state' => ['in', [1, 2, 3]]
];
$aReviewer = Db::name('article_reviewer')->where($aWhere)->column('reviewer_id,state');
- if(empty($aReviewer)){
- return json(['status' => 1,'msg' => '未查询到审核人信息']);
+ if (empty($aReviewer)) {
+ return json(['status' => 1, 'msg' => '未查询到审核人信息']);
}
//查询审核人信息
$aUserId = array_keys($aReviewer);
- $aUser = Db::name('user')->field('user_id,rs_num,right_times,error_times,major_times')->whereIn('user_id',$aUserId)->select();
- if(empty($aUser)){
- return json(['status' => 1,'msg' => '未查询到审核人信息']);
+ $aUser = Db::name('user')->field('user_id,rs_num,right_times,error_times,major_times')->whereIn('user_id', $aUserId)->select();
+ if (empty($aUser)) {
+ return json(['status' => 1, 'msg' => '未查询到审核人信息']);
}
//处理数据并组装数据
- $aCase = ['right_times' => '', 'right_rate' => '','error_times' => '', 'error_rate' => '','major_times' => '', 'major_rate' => ''];
- $aToState = [2 => 3,3 => 5];//文章3拒稿5录用 审稿人2拒稿3通过
+ $aCase = ['right_times' => '', 'right_rate' => '', 'error_times' => '', 'error_rate' => '', 'major_times' => '', 'major_rate' => ''];
+ $aToState = [2 => 3, 3 => 5];//文章3拒稿5录用 审稿人2拒稿3通过
foreach ($aUser as $key => $value) {
$iState = empty($aReviewer[$value['user_id']]) ? 0 : $aReviewer[$value['user_id']];
- if(empty($iState)){
+ if (empty($iState)) {
continue;
}
- if(empty($aToState[$iState])){
- if($iState == 1){
- $iMajorTimes = $value['major_times']+1;
- $iMajorRate = empty($value['rs_num']) ? 0 : round($iMajorTimes/$value['rs_num'],2);
+ if (empty($aToState[$iState])) {
+ if ($iState == 1) {
+ $iMajorTimes = $value['major_times'] + 1;
+ $iMajorRate = empty($value['rs_num']) ? 0 : round($iMajorTimes / $value['rs_num'], 2);
$aCase['major_times'] .= "WHEN {$value['user_id']} THEN ";
$aCase['major_times'] .= "'{$iMajorTimes}' ";
$aCase['major_rate'] .= "WHEN {$value['user_id']} THEN ";
@@ -4482,107 +4574,110 @@ class Article extends Base
}
continue;
}
- if($aArticle['state'] == $aToState[$iState]){
- $iTimes = $value['right_times']+1;
- $iRightRate = empty($value['rs_num']) ? 0 : round($iTimes/$value['rs_num'],2);
+ if ($aArticle['state'] == $aToState[$iState]) {
+ $iTimes = $value['right_times'] + 1;
+ $iRightRate = empty($value['rs_num']) ? 0 : round($iTimes / $value['rs_num'], 2);
$aCase['right_times'] .= "WHEN {$value['user_id']} THEN ";
$aCase['right_times'] .= "'{$iTimes}' ";
$aCase['right_rate'] .= "WHEN {$value['user_id']} THEN ";
$aCase['right_rate'] .= "'{$iRightRate}' ";
}
- if($aArticle['state'] != $aToState[$iState]){
- $iErrorTimes = $value['error_times']+1;
- $iErrorRate = empty($value['rs_num']) ? 0 : round($iErrorTimes/$value['rs_num'],2);
+ if ($aArticle['state'] != $aToState[$iState]) {
+ $iErrorTimes = $value['error_times'] + 1;
+ $iErrorRate = empty($value['rs_num']) ? 0 : round($iErrorTimes / $value['rs_num'], 2);
$aCase['error_times'] .= "WHEN {$value['user_id']} THEN ";
$aCase['error_times'] .= "'{$iErrorTimes}' ";
$aCase['error_rate'] .= "WHEN {$value['user_id']} THEN ";
$aCase['error_rate'] .= "'{$iErrorRate}' ";
}
$aId[] = $value['user_id'];
- }
+ }
//更新数据库
foreach ($aCase as $key => $value) {
- if(empty($value)){
+ if (empty($value)) {
continue;
}
- $aUpdate[$key] = Db::raw('CASE user_id '.$value.'END');
+ $aUpdate[$key] = Db::raw('CASE user_id ' . $value . 'END');
}
- if(empty($aUpdate) || empty($aId)){
- return json(['status' => 1,'msg' => '未查询到审核人信息']);
+ if (empty($aUpdate) || empty($aId)) {
+ return json(['status' => 1, 'msg' => '未查询到审核人信息']);
}
Db::name('user')->where('user_id', 'IN', $aId)->limit(count($aId))->update($aUpdate);
- return json(['status' => 1,'msg' => '执行成功']);
+ return json(['status' => 1, 'msg' => '执行成功']);
}
/**
* 获取文章所属领域
* @param reviewer_id 审核人ID
- * @param
+ * @param
*/
- public function getArticleField($aParam = []){
+ public function getArticleField($aParam = [])
+ {
$aParam = empty($aParam) ? $this->request->post() : $this->request->post();
-
- if(empty($aParam['article_id'])){
- return json_encode(['status' => 2,'msg' => 'Please select a Article']);
+
+ if (empty($aParam['article_id'])) {
+ return json_encode(['status' => 2, 'msg' => 'Please select a Article']);
}
//查询审稿人领域信息
$aParam['state'] = 0;
$aReviewerMajor = Db::name('major_to_article')->field('major_id')->where($aParam)->order('major_id asc')->select();
- if(empty($aReviewerMajor)){
- return json_encode(['status' => 1,'msg' => "The article field is empty",'data' => []]);
+ if (empty($aReviewerMajor)) {
+ return json_encode(['status' => 1, 'msg' => "The article field is empty", 'data' => []]);
}
//数据处理
foreach ($aReviewerMajor as $key => $value) {
- $aReviewerMajor[$key]['major_title'] = getMajorStr($value['major_id']);
- $aReviewerMajor[$key]['shu'] = getMajorShu($value['major_id']);
+ $aReviewerMajor[$key]['major_title'] = getMajorStr($value['major_id']);
+ $aReviewerMajor[$key]['shu'] = getMajorShu($value['major_id']);
}
- return json_encode(['status' => 1,'msg' => "success",'data' => $aReviewerMajor]);
+ return json_encode(['status' => 1, 'msg' => "success", 'data' => $aReviewerMajor]);
}
+
/**
* 修改文章所属领域
* @param reviewer_id 审核人ID
- * @param
+ * @param
*/
- public function updateArticleField($aParam = []){
+ public function updateArticleField($aParam = [])
+ {
$aParam = empty($aParam) ? $this->request->post() : $this->request->post();
$iArticleId = empty($aParam['article_id']) ? 0 : $aParam['article_id'];
- if(empty($iArticleId)){
- return json_encode(['status' => 2,'msg' => 'Please select a article']);
+ if (empty($iArticleId)) {
+ return json_encode(['status' => 2, 'msg' => 'Please select a article']);
}
$sField = empty($aParam['article_field']) ? '' : $aParam['article_field'];
- if(empty($sField)){
- return json_encode(['status' => 2,'msg' => "Please select the field to which the article belongs"]);
+ if (empty($sField)) {
+ return json_encode(['status' => 2, 'msg' => "Please select the field to which the article belongs"]);
}
- $aField = is_array($sField) ? $sField : explode(',', trim($sField,','));
- if(empty($aField)){
- return json_encode(['status' => 3,'msg' => "Please select the user's field of expertise"]);
+ $aField = is_array($sField) ? $sField : explode(',', trim($sField, ','));
+ if (empty($aField)) {
+ return json_encode(['status' => 3, 'msg' => "Please select the user's field of expertise"]);
}
//查询审稿人领域信息
- $aWhere = ['state' => 0,'article_id' => $iArticleId];
+ $aWhere = ['state' => 0, 'article_id' => $iArticleId];
$aArticleMajor = Db::name('major_to_article')->where($aWhere)->order('major_id asc')->column('major_id');
//新增
- $aInsert = array_diff($aField,$aArticleMajor);
+ $aInsert = array_diff($aField, $aArticleMajor);
//删除
- $aDelete = array_diff($aArticleMajor,$aField);
+ $aDelete = array_diff($aArticleMajor, $aField);
//数据处理
Db::startTrans();
- if(!empty($aInsert)){//新增
+ if (!empty($aInsert)) {//新增
foreach ($aInsert as $key => $value) {
- $aAdd[] = ['major_id' => $value,'article_id' => $iArticleId,'ctime' => time(),'state' => 0];
+ $aAdd[] = ['major_id' => $value, 'article_id' => $iArticleId, 'ctime' => time(), 'state' => 0];
}
$result = Db::name('major_to_article')->insertAll($aAdd);
- }
- if(!empty($aDelete)){//修改状态为1
- $aWhere = ['article_id' => $iArticleId,'state' => 0,'major_id' => ['in',$aDelete]];
- $result = Db::name('major_to_article')->where($aWhere)->limit(count($aDelete))->update(['state' => 1,'ctime' => time()]);
- }
+ }
+ if (!empty($aDelete)) {//修改状态为1
+ $aWhere = ['article_id' => $iArticleId, 'state' => 0, 'major_id' => ['in', $aDelete]];
+ $result = Db::name('major_to_article')->where($aWhere)->limit(count($aDelete))->update(['state' => 1, 'ctime' => time()]);
+ }
Db::commit();
- return json_encode(['status' => 1,'msg' => "The field to which the article belongs has been successfully updated"]);
+ return json_encode(['status' => 1, 'msg' => "The field to which the article belongs has been successfully updated"]);
}
}
diff --git a/application/api/controller/Order.php b/application/api/controller/Order.php
index d2ece04..19e8954 100644
--- a/application/api/controller/Order.php
+++ b/application/api/controller/Order.php
@@ -266,6 +266,7 @@ class Order extends base{
}
+
private function creatPaystation($article_id){
$article_info = $this->article_obj->where("article_id",$article_id)->find();
$journal_info = $this->journal_obj->where("journal_id",$article_info['journal_id'])->find();
@@ -276,7 +277,7 @@ class Order extends base{
'gateway_id' => "PAYSTATION",//GATEWAY_ID,
"merchant_session" => $ca_sn,
"merchant_reference"=>$ca_sn,
- "amount" =>(int)((((int)$journal_info['fee'])*726/416)*100),
+ "amount" =>(int)(prin($journal_info['fee'])*100),//(int)((((int)$journal_info['fee'])*726/416)*100),
"return_url"=>"https://submission.tmrjournals.com/success?id=".$article_info['article_id'],
"response_url"=>"http://api.tmrjournals.com/public/index.php/api/Order/completePaystation"
];
diff --git a/application/api/controller/Reviewer.php b/application/api/controller/Reviewer.php
index 3283a5c..8a337bb 100644
--- a/application/api/controller/Reviewer.php
+++ b/application/api/controller/Reviewer.php
@@ -2607,7 +2607,7 @@ class Reviewer extends Base
//发送email->编辑
$tt = 'Dear editor,
';
- $tt .= 'Please check the new comments from the reviewer.
';
+ $tt .= 'Please check the new comments from the reviewer.sn:'.$article_info['accept_sn'].'
';
$tt .= 'Journal:' . $journal_info['title'] . ' and article title:' . $article_info['title'];
$sendEditor = [