This commit is contained in:
wangjinlei
2023-06-21 11:13:22 +08:00
parent 3bd136071d
commit 5679ccb8b0
3 changed files with 33 additions and 6 deletions

View File

@@ -150,8 +150,10 @@ class Article extends Base
$userres = $this->user_obj->where(['account' => $data['username']])->column('user_id');
$journal_list = $this->journal_obj->where(['editor_id' => $userres[0]])->column('journal_id');
$where['t_article.journal_id'] = ['in', $journal_list];
$where_s['t_article.journal_id'] = ['in', $journal_list];
} else {
$where['t_article.journal_id'] = $data['journal'];
$where_s['t_article.journal_id'] = $data['journal'];
}
if ($data['state'] >= 0) {
$where['t_article.state'] = $data['state'];
@@ -199,6 +201,14 @@ class Article extends Base
//查询文章通讯作者的账号信息
$res[$key]['reports'] = $this->getReportAuthors($val['article_id']);
//添加file
$res_file = $this->article_file_obj->where("article_id",$val['article_id'])->select();
$file_frag = [];
foreach ($res_file as $v) {
$file_frag[$v['type_name']][] = $v;
}
$res[$key]['file'] = $file_frag;
}
//添加国家信息
@@ -218,10 +228,19 @@ class Article extends Base
$cache = $this->email_log_obj->where('article_id', $v['article_id'])->where('is_success', 1)->select();
$res[$k]['emailh'] = $cache ? 1 : 0;
}
//添加各个状态下文章的数量
$state_num = $this->article_obj->field("t_article.state,count(*) as num")->where($where_s)->group("state")->select();
foreach ($state_num as $item) {
$num_arr[$item['state']] = $item['num'];
}
for ($i=0;$i<6;$i++){
$num_frag[$i] = isset($num_arr[$i])?$num_arr[$i]:0;
}
$count = $this->article_obj->where($where)->count();
return json(['total' => $count, 'data' => $res]);
return json(['total' => $count, 'data' => $res,"state_num"=>$num_frag]);
}
private function getReportAuthors($article_id)
@@ -2126,7 +2145,7 @@ class Article extends Base
$report_tt .= "and you can access your account by visiting " . $journal_info['website'] . " and logging in.<br/><br/>";
$report_tt .= "If you have any questions or need assistance with accessing your account, please don't hesitate to contact us. We are here to support you throughout the submission and review process.<br/><br/>";
$report_tt .= "Thank you for choosing to submit your work to our journal. We look forward to working with you.<br/><br/>";
$report_tt .= "Best regards,<br>" . $inser_data['realname'] . '<br/>' . $journal_info['title'];
$report_tt .= "Best regards,<br>Editorial Office" . '<br/>' . $journal_info['title'];
$maidata['email'] = trim($v['email']);
$maidata['title'] = $journal_info['title'];
$maidata['content'] = $report_tt;

View File

@@ -139,6 +139,13 @@ class Preaccept extends Base
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$doi = trim($data['doi']);
$url = "https://citation.crosscite.org/format?doi=$doi&style=cancer-translational-medicine&lang=en-US";
$res = myGet($url);
$frag = trim(substr($res, strpos($res, '.') + 1));
if ($frag == "") {
return jsonError("doi error");
}
$this->production_article_refer_obj->where('p_refer_id',$data['p_refer_id'])->update(['refer_doi'=>$data['doi']]);
my_doiToFrag2($this->production_article_refer_obj->where('p_refer_id',$data['p_refer_id'])->find());
return jsonSuccess([]);

View File

@@ -413,15 +413,16 @@ class Promotion extends Base
//发送邮件
foreach ($list as $v) {
$template = str_replace("{{user_major}}", $this->getMajorOne($v['major']), $template);
$template = str_replace("{{user_name}}", $v['name'], $template);
$template = str_replace("{{unsubscribe}}", "https://submission.tmrjournals.com/api/Promotion/NoEmail?lib=" . $v['type'] . "&id=" . $v['id'], $template);
$template1 = $template;
$template1 = str_replace("{{user_major}}", $this->getMajorOne($v['major']), $template1);
$template1 = str_replace("{{user_name}}", $v['name'], $template1);
$template1 = str_replace("{{unsubscribe}}", "https://submission.tmrjournals.com/api/Promotion/NoEmail?lib=" . $v['type'] . "&id=" . $v['id'], $template1);
$email_title = $pro_info['email_title'];
$email_title = str_replace("{{journal_title}}", $journal_info['title'], $email_title);
$email_title = str_replace("{{journal_issn}}", $journal_info['issn'], $email_title);
$ali['email'] = $v['email'];
$ali['title'] = $email_title;
$ali['content'] = $template;
$ali['content'] = $template1;
$ali['has_hb'] = $pro_info['has_hb'];
Queue::push('app\api\job\mail@promotion', $ali, "tmail");