1
This commit is contained in:
@@ -150,8 +150,10 @@ class Article extends Base
|
|||||||
$userres = $this->user_obj->where(['account' => $data['username']])->column('user_id');
|
$userres = $this->user_obj->where(['account' => $data['username']])->column('user_id');
|
||||||
$journal_list = $this->journal_obj->where(['editor_id' => $userres[0]])->column('journal_id');
|
$journal_list = $this->journal_obj->where(['editor_id' => $userres[0]])->column('journal_id');
|
||||||
$where['t_article.journal_id'] = ['in', $journal_list];
|
$where['t_article.journal_id'] = ['in', $journal_list];
|
||||||
|
$where_s['t_article.journal_id'] = ['in', $journal_list];
|
||||||
} else {
|
} else {
|
||||||
$where['t_article.journal_id'] = $data['journal'];
|
$where['t_article.journal_id'] = $data['journal'];
|
||||||
|
$where_s['t_article.journal_id'] = $data['journal'];
|
||||||
}
|
}
|
||||||
if ($data['state'] >= 0) {
|
if ($data['state'] >= 0) {
|
||||||
$where['t_article.state'] = $data['state'];
|
$where['t_article.state'] = $data['state'];
|
||||||
@@ -199,6 +201,14 @@ class Article extends Base
|
|||||||
|
|
||||||
//查询文章通讯作者的账号信息
|
//查询文章通讯作者的账号信息
|
||||||
$res[$key]['reports'] = $this->getReportAuthors($val['article_id']);
|
$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();
|
$cache = $this->email_log_obj->where('article_id', $v['article_id'])->where('is_success', 1)->select();
|
||||||
$res[$k]['emailh'] = $cache ? 1 : 0;
|
$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();
|
$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)
|
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 .= "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 .= "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 .= "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['email'] = trim($v['email']);
|
||||||
$maidata['title'] = $journal_info['title'];
|
$maidata['title'] = $journal_info['title'];
|
||||||
$maidata['content'] = $report_tt;
|
$maidata['content'] = $report_tt;
|
||||||
|
|||||||
@@ -139,6 +139,13 @@ class Preaccept extends Base
|
|||||||
if(!$rule->check($data)){
|
if(!$rule->check($data)){
|
||||||
return jsonError($rule->getError());
|
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']]);
|
$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());
|
my_doiToFrag2($this->production_article_refer_obj->where('p_refer_id',$data['p_refer_id'])->find());
|
||||||
return jsonSuccess([]);
|
return jsonSuccess([]);
|
||||||
|
|||||||
@@ -413,15 +413,16 @@ class Promotion extends Base
|
|||||||
|
|
||||||
//发送邮件
|
//发送邮件
|
||||||
foreach ($list as $v) {
|
foreach ($list as $v) {
|
||||||
$template = str_replace("{{user_major}}", $this->getMajorOne($v['major']), $template);
|
$template1 = $template;
|
||||||
$template = str_replace("{{user_name}}", $v['name'], $template);
|
$template1 = str_replace("{{user_major}}", $this->getMajorOne($v['major']), $template1);
|
||||||
$template = str_replace("{{unsubscribe}}", "https://submission.tmrjournals.com/api/Promotion/NoEmail?lib=" . $v['type'] . "&id=" . $v['id'], $template);
|
$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 = $pro_info['email_title'];
|
||||||
$email_title = str_replace("{{journal_title}}", $journal_info['title'], $email_title);
|
$email_title = str_replace("{{journal_title}}", $journal_info['title'], $email_title);
|
||||||
$email_title = str_replace("{{journal_issn}}", $journal_info['issn'], $email_title);
|
$email_title = str_replace("{{journal_issn}}", $journal_info['issn'], $email_title);
|
||||||
$ali['email'] = $v['email'];
|
$ali['email'] = $v['email'];
|
||||||
$ali['title'] = $email_title;
|
$ali['title'] = $email_title;
|
||||||
$ali['content'] = $template;
|
$ali['content'] = $template1;
|
||||||
$ali['has_hb'] = $pro_info['has_hb'];
|
$ali['has_hb'] = $pro_info['has_hb'];
|
||||||
|
|
||||||
Queue::push('app\api\job\mail@promotion', $ali, "tmail");
|
Queue::push('app\api\job\mail@promotion', $ali, "tmail");
|
||||||
|
|||||||
Reference in New Issue
Block a user