小bug调整

This commit is contained in:
wangjinlei
2025-05-16 15:34:04 +08:00
parent 65e0f5ccc8
commit a5f6ec2dca
3 changed files with 16 additions and 9 deletions

View File

@@ -580,10 +580,10 @@ class Journal extends Controller {
$stage_info = $this->journal_stage_obj->where('journal_stage_id', $journal_info['publish_stage_id'])->find();
$list = strongArticleList($list);
foreach ($list as $k => $v){
$cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic', 'j_journal_topic.journal_topic_id = j_article_to_topic.topic_id', 'left')->where('j_article_to_topic.article_id', $v['article_id'])->where('j_article_to_topic.state', 0)->select();
$list[$k]['topic'] = $cache_topic;
}
// foreach ($list as $k => $v){
// $cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic', 'j_journal_topic.journal_topic_id = j_article_to_topic.topic_id', 'left')->where('j_article_to_topic.article_id', $v['article_id'])->where('j_article_to_topic.state', 0)->select();
// $list[$k]['topic'] = $cache_topic;
// }
return json(['code' => 0, 'msg' => 'success', 'data' => ['stage' => $stage_info, 'articleList' => $list]]);
}

View File

@@ -350,6 +350,7 @@ function strongArticleList($list){
$journal_obj = Db::name("journal");
$journals_ltai_obj = Db::name("article_ltai");
$article_cite_obj = Db::name("article_cite");
$article_to_topic_obj = Db::name("article_to_topic");
foreach ($list as $k => $v) {
$stage_info = $journal_stage_obj->where('journal_stage_id', $v['journal_stage_id'])->find();
$journal_info = $journal_obj->where('journal_id', $v['journal_id'])->find();
@@ -377,6 +378,10 @@ function strongArticleList($list){
$cache_title = str_replace($val, '<i>' . $val . '</i>', $cache_title);
}
$list[$k]['title'] = $cache_title;
$cache_topic = $article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic', 'j_journal_topic.journal_topic_id = j_article_to_topic.topic_id', 'left')->where('j_article_to_topic.article_id', $v['article_id'])->where('j_article_to_topic.state', 0)->select();
$list[$k]['topic'] = $cache_topic;
}
//连续出版判断,决定是否显示出版时间
foreach ($list as $k => $v){

View File

@@ -492,7 +492,7 @@ class Article extends Controller
//处理话题,相关文章
if (isset($data['related'])&&$data['related']!=""){
$insert['related'] = $data['related'];
$insert['related'] = json_encode(object_to_array(json_decode($data['related'])));
}
$insert['sort'] = $sort;
@@ -530,6 +530,8 @@ class Article extends Controller
$author_res = true;
$ato_res = true;
$ca_au_id = true;
foreach ($authors as $v) {
$insert_author['article_id'] = $aid;
$insert_author['author_name'] = $journal_info['journal_id'] == 22 ? $v['last_name'] . $v['first_name'] : $v['first_name'] . ' ' . $v['last_name'];
@@ -560,17 +562,17 @@ class Article extends Controller
return jsonError($e->getMessage());
}
//处理话题,相关文章
if (isset($data['topics'])&&$data['topics']!=""){
$ll = json_decode($data['topics']);
$ll = object_to_array(json_decode($data['topics']));
foreach ($ll as $v){
$cac_topic['article_id'] = $aid;
$cac_topic['topic_id'] = $v;
$this->journal_topic_obj->insert($cac_topic);
$this->article_to_topic_obj->insert($cac_topic);
}
}
if ($aid && $organ_res && $ltai_res && $author_res && $ato_res && $ca_au_id) {
Db::commit();
$this->pushDoiToCrossref($data['doi'], $aid);