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;