diff --git a/application/api/controller/Article.php b/application/api/controller/Article.php index a340611..95e9cc2 100644 --- a/application/api/controller/Article.php +++ b/application/api/controller/Article.php @@ -94,6 +94,24 @@ class Article extends Controller { $article_info['first_page'] = $cc[0]; $article_info['last_page'] = $cc[1]; } + + //添加orDoi + if($article_info['journal_id']==1&&$article_info['article_id']<1540){ + $article_info['ordoi'] = str_replace("10.53388", "10.12032", $article_info['doi']); + }elseif($article_info['journal_id']==14&&$article_info['article_id']<1540){ + $article_info['ordoi'] = str_replace("10.53388", "10.12032", $article_info['doi']); + }elseif($article_info['journal_id']==17&&$article_info['article_id']>=735&&$article_info['article_id']<=1534){ + $article_info['ordoi'] = str_replace("10.53388", "10.12032", $article_info['doi']); + }elseif($article_info['journal_id']==8&&$article_info['article_id']>=591&&$article_info['article_id']<=1535){ + $article_info['ordoi'] = str_replace("10.53388", "10.12032", $article_info['doi']); + }elseif($article_info['journal_id']==13&&$article_info['article_id']>=256&&$article_info['article_id']<=1486){ + $article_info['ordoi'] = str_replace("10.53388", "10.12032", $article_info['doi']); + }elseif($article_info['journal_id']==4&&$article_info['article_id']>=872&&$article_info['article_id']<=1508){ + $article_info['ordoi'] = str_replace("10.53388", "10.12032", $article_info['doi']); + }else{ + $article_info['ordoi'] = ''; + } + $article_info['publication'] = date('Y/m/d', strtotime($article_info['pub_date'])); @@ -277,6 +295,15 @@ class Article extends Controller { } $list[$k]['title'] = $cache_title; } + //连续出版判断,决定是否显示出版时间 + foreach ($list as $k => $v){ + $ca_stage = $this->journal_stage_obj->where('journal_stage_id',$v['journal_stage_id'])->find(); + if(($v['journal_id']==2&&$ca_stage['stage_year']>=2022)||($v['journal_id']==18&&$ca_stage['stage_year']>=2022)||($v['journal_id']==17&&$ca_stage['stage_year']>=2019)){ + $list[$k]['isShowOtime'] = 1; + }else{ + $list[$k]['isShowOtime'] = 0; + } + } $re['topicInfo'] = $topic_info; $re['articleList'] = $list; $re['count'] = $count; @@ -342,6 +369,15 @@ class Article extends Controller { } $list[$k]['title'] = $cache_title; } + //连续出版判断,决定是否显示出版时间 + foreach ($list as $k => $v){ + $ca_stage = $this->journal_stage_obj->where('journal_stage_id',$v['journal_stage_id'])->find(); + if(($v['journal_id']==2&&$ca_stage['stage_year']>=2022)||($v['journal_id']==18&&$ca_stage['stage_year']>=2022)||($v['journal_id']==17&&$ca_stage['stage_year']>=2019)){ + $list[$k]['isShowOtime'] = 1; + }else{ + $list[$k]['isShowOtime'] = 0; + } + } $l = choiseJtitle($list); $re['stageInfo'] = $stage_info; $re['articleList'] = $l; @@ -451,6 +487,15 @@ class Article extends Controller { } $list[$k]['title'] = $cache_title; } + //连续出版判断,决定是否显示出版时间 + foreach ($list as $k => $v){ + $ca_stage = $this->journal_stage_obj->where('journal_stage_id',$v['journal_stage_id'])->find(); + if(($v['journal_id']==2&&$ca_stage['stage_year']>=2022)||($v['journal_id']==18&&$ca_stage['stage_year']>=2022)||($v['journal_id']==17&&$ca_stage['stage_year']>=2019)){ + $list[$k]['isShowOtime'] = 1; + }else{ + $list[$k]['isShowOtime'] = 0; + } + } $re['articleList'] = $list; $re['count'] = $count; diff --git a/application/api/controller/Journal.php b/application/api/controller/Journal.php index eb53ab6..dc5b563 100644 --- a/application/api/controller/Journal.php +++ b/application/api/controller/Journal.php @@ -36,8 +36,6 @@ class Journal extends Controller { protected $base_topic_obj = ''; protected $subscribe_base_topic_obj = ''; - - public function __construct(\think\Request $request = null) { parent::__construct($request); $this->admin_obj = Db::name('admin'); @@ -140,12 +138,12 @@ class Journal extends Controller { * @param name:issn type:string require:1 desc:issn号 * */ - public function getJournalByIssn(){ + public function getJournalByIssn() { $data = $this->request->post(); - $journal_info = $this->journal_obj->where('issn',$data['issn'])->find(); + $journal_info = $this->journal_obj->where('issn', $data['issn'])->find(); return jsonSuccess($journal_info); - } - + } + /** * @title 获取期刊话题 * @description 获取期刊话题 @@ -252,14 +250,24 @@ class Journal extends Controller { $stage_info = $this->journal_stage_obj->where('journal_stage_id', $v['journal_stage_id'])->find(); //组合cite信息 $no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):'; - $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi']; - $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(); + $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi']; + $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; $list[$k]['cite'] = $cite; $list[$k]['authortitle'] = $this->getAuthor($v); } + //连续出版判断,决定是否显示出版时间 + foreach ($list as $k => $v) { + $ca_stage = $this->journal_stage_obj->where('journal_stage_id', $v['journal_stage_id'])->find(); + if (($v['journal_id'] == 2 && $ca_stage['stage_year'] >= 2022) || ($v['journal_id'] == 18 && $ca_stage['stage_year'] >= 2022) || ($v['journal_id'] == 17 && $ca_stage['stage_year'] >= 2019)) { + $list[$k]['isShowOtime'] = 1; + } else { + $list[$k]['isShowOtime'] = 0; + } + } + // //获取作者 // foreach ($list as $k => $v) { // $list[$k]['authortitle'] = $this->getAuthor($v); @@ -269,7 +277,7 @@ class Journal extends Controller { $re['articles'] = $list; return jsonSuccess($re); } - + /** * @title 获取期刊五个话题 * @description 获取期刊五个话题 @@ -279,18 +287,18 @@ class Journal extends Controller { * * @return journals:期刊话题列表array# */ - public function getJournalFiveTopics(){ - $journals = $this->journal_obj->where('state',0)->select(); - foreach ($journals as $k => $v){ - $topic_info = $this->journal_topic_obj->where('journal_id',$v['journal_id'])->where('title','Topics')->where('state',0)->find(); - $cache = $this->journal_topic_obj->where('parent_id',$topic_info['journal_topic_id'])->where('state',0)->limit(5)->select(); + public function getJournalFiveTopics() { + $journals = $this->journal_obj->where('state', 0)->select(); + foreach ($journals as $k => $v) { + $topic_info = $this->journal_topic_obj->where('journal_id', $v['journal_id'])->where('title', 'Topics')->where('state', 0)->find(); + $cache = $this->journal_topic_obj->where('parent_id', $topic_info['journal_topic_id'])->where('state', 0)->limit(5)->select(); $journals[$k]['topics'] = $cache; } - + $re['journals'] = $journals; return jsonSuccess($re); } - + /** * @title 获取所有期刊话题 * @description 获取所有期刊话题 @@ -300,18 +308,18 @@ class Journal extends Controller { * * @return topic:话题列表array# */ - public function getAllTopics(){ - $parents = $this->base_topic_obj->where('parent_id',0)->where('state',0)->order('sort desc')->select(); - $topicIds = $this->journal_topic_obj->where('title','Topics')->where('state',0)->column('journal_topic_id'); - $ca = $this->journal_topic_obj->where('parent_id','in',$topicIds)->where('state',0)->select(); - foreach ($parents as $k => $v){ - $cache = $this->base_topic_obj->where('parent_id',$v['base_topic_id']) - ->where('state',0) + public function getAllTopics() { + $parents = $this->base_topic_obj->where('parent_id', 0)->where('state', 0)->order('sort desc')->select(); + $topicIds = $this->journal_topic_obj->where('title', 'Topics')->where('state', 0)->column('journal_topic_id'); + $ca = $this->journal_topic_obj->where('parent_id', 'in', $topicIds)->where('state', 0)->select(); + foreach ($parents as $k => $v) { + $cache = $this->base_topic_obj->where('parent_id', $v['base_topic_id']) + ->where('state', 0) ->order('sort desc') ->select(); $cache1 = []; - foreach ($cache as $val){ - if($this->myCheckTopic($val['title'],$ca)){ + foreach ($cache as $val) { + if ($this->myCheckTopic($val['title'], $ca)) { $cache1[] = $val; } } @@ -320,11 +328,11 @@ class Journal extends Controller { $re['topic'] = $parents; return jsonSuccess($re); } - - private function myCheckTopic($value,$array){ + + private function myCheckTopic($value, $array) { $frag = false; - foreach ($array as $v){ - if($v['title']==$value){ + foreach ($array as $v) { + if ($v['title'] == $value) { $frag = true; break; } @@ -332,17 +340,16 @@ class Journal extends Controller { return $frag; } - - private function check_topic($value,$frag){ + private function check_topic($value, $frag) { $fra = false; - foreach ($frag as $k => $v){ - if($value['title'] == $v['title']){ + foreach ($frag as $k => $v) { + if ($value['title'] == $v['title']) { $fra = true; } } return $fra; } - + /** * @title 查找话题期刊 * @description 查找话题期刊 @@ -354,27 +361,27 @@ class Journal extends Controller { * * @return journals:期刊list# */ - public function findJournalTopic1(){ + public function findJournalTopic1() { $data = $this->request->post(); - $base_topic = $this->base_topic_obj->where('base_topic_id',$data['topic'])->find(); - $topicids = $this->journal_topic_obj->where('title','Topics')->where('state',0)->column('journal_topic_id'); + $base_topic = $this->base_topic_obj->where('base_topic_id', $data['topic'])->find(); + $topicids = $this->journal_topic_obj->where('title', 'Topics')->where('state', 0)->column('journal_topic_id'); $list = $this->journal_topic_obj ->field('j_journal.*,j_journal_topic.title topic_title,j_journal_topic.journal_topic_id') - ->join('j_journal','j_journal.journal_id = j_journal_topic.journal_id','left') - ->where('j_journal_topic.parent_id','in',$topicids) - ->where('j_journal_topic.state',0) - ->where('j_journal_topic.title','like','%'.$base_topic['title'].'%') + ->join('j_journal', 'j_journal.journal_id = j_journal_topic.journal_id', 'left') + ->where('j_journal_topic.parent_id', 'in', $topicids) + ->where('j_journal_topic.state', 0) + ->where('j_journal_topic.title', 'like', '%' . $base_topic['title'] . '%') ->select(); - - foreach ($list as $k => $v){ - $abs = $this->journal_abs_obj->where('journal_id',$v['journal_id'])->where('state',0)->order('sort')->limit(4)->select(); + + foreach ($list as $k => $v) { + $abs = $this->journal_abs_obj->where('journal_id', $v['journal_id'])->where('state', 0)->order('sort')->limit(4)->select(); $list[$k]['abs'] = $abs; } - + $re['journals'] = $list; return jsonSuccess($re); } - + /** * @title 查找话题期刊 * @description 查找话题期刊 @@ -386,38 +393,38 @@ class Journal extends Controller { * * @return journals:期刊list# */ - public function findJournalTopic(){ + public function findJournalTopic() { $data = $this->request->post(); $list = []; - if($data['journal_topic_id'] == 0){ - $journals = $this->journal_obj->where('state',0)->order("sort desc")->select(); - foreach ($journals as $k => $v){ - $topic_info = $this->journal_topic_obj->where('journal_id',$v['journal_id'])->where('title','Topics')->where('state',0)->find(); - $cache = $this->journal_topic_obj->where('parent_id',$topic_info['journal_topic_id'])->where('state',0)->limit(5)->select(); + if ($data['journal_topic_id'] == 0) { + $journals = $this->journal_obj->where('state', 0)->order("sort desc")->select(); + foreach ($journals as $k => $v) { + $topic_info = $this->journal_topic_obj->where('journal_id', $v['journal_id'])->where('title', 'Topics')->where('state', 0)->find(); + $cache = $this->journal_topic_obj->where('parent_id', $topic_info['journal_topic_id'])->where('state', 0)->limit(5)->select(); $journals[$k]['topics'] = $cache; } $list = $journals; - }else{ - $topic_info = $this->journal_topic_obj->where('journal_topic_id',$data['journal_topic_id'])->find(); - $tpids = $this->journal_topic_obj->where('title','Topics')->where('state',0)->column('journal_topic_id'); + } else { + $topic_info = $this->journal_topic_obj->where('journal_topic_id', $data['journal_topic_id'])->find(); + $tpids = $this->journal_topic_obj->where('title', 'Topics')->where('state', 0)->column('journal_topic_id'); $journals = $this->journal_topic_obj ->field('j_journal.*,j_journal_topic.title topic_title,j_journal_topic.journal_topic_id') - ->join('j_journal','j_journal.journal_id = j_journal_topic.journal_id','left') - ->where('j_journal_topic.parent_id','in',$tpids) - ->where('j_journal_topic.title',$topic_info['title']) - ->where('j_journal_topic.state',0) + ->join('j_journal', 'j_journal.journal_id = j_journal_topic.journal_id', 'left') + ->where('j_journal_topic.parent_id', 'in', $tpids) + ->where('j_journal_topic.title', $topic_info['title']) + ->where('j_journal_topic.state', 0) ->order("j_journal.sort desc") ->select(); $list = $journals; } - foreach ($list as $k => $v){ - $abs = $this->journal_abs_obj->where('journal_id',$v['journal_id'])->where('state',0)->order('sort')->limit(4)->select(); + foreach ($list as $k => $v) { + $abs = $this->journal_abs_obj->where('journal_id', $v['journal_id'])->where('state', 0)->order('sort')->limit(4)->select(); $list[$k]['abs'] = $abs; } $re['journals'] = $list; return jsonSuccess($re); } - + /** * @title 获取通用话题文章 * @description 获取通用话题文章 @@ -432,43 +439,53 @@ class Journal extends Controller { * @return articleList:文章信息# * @return count:总数 */ - public function getBaseTopicArticles(){ + public function getBaseTopicArticles() { $data = $this->request->post(); $limit_start = ($data['pageIndex'] - 1) * $data['pageSize']; - $base_topic_info = $this->base_topic_obj->where('base_topic_id',$data['base_topic_id'])->find(); - $chileds = $this->base_topic_obj->where('parent_id',$base_topic_info['base_topic_id'])->where('state',0)->select(); - $topicids = $this->journal_topic_obj->where('title',$base_topic_info['title'])->where('state',0)->column('journal_topic_id'); - foreach ($chileds as $v){ - $cache_ids = $this->journal_topic_obj->where('title',$v['title'])->where('state',0)->column('journal_topic_id'); - $topicids = array_merge($topicids,$cache_ids); + $base_topic_info = $this->base_topic_obj->where('base_topic_id', $data['base_topic_id'])->find(); + $chileds = $this->base_topic_obj->where('parent_id', $base_topic_info['base_topic_id'])->where('state', 0)->select(); + $topicids = $this->journal_topic_obj->where('title', $base_topic_info['title'])->where('state', 0)->column('journal_topic_id'); + foreach ($chileds as $v) { + $cache_ids = $this->journal_topic_obj->where('title', $v['title'])->where('state', 0)->column('journal_topic_id'); + $topicids = array_merge($topicids, $cache_ids); } - $ids = $this->article_to_topic_obj->where('topic_id','in',$topicids)->where('state',0)->column('article_id'); + $ids = $this->article_to_topic_obj->where('topic_id', 'in', $topicids)->where('state', 0)->column('article_id'); $list = $this->article_obj ->field('j_article.*,j_journal_stage.*,j_journal.jabbr,j_journal.usx,j_journal.title journal_title') - ->join('j_journal','j_article.journal_id = j_journal.journal_id','left') - ->join('j_journal_stage','j_article.journal_stage_id = j_journal_stage.journal_stage_id','left') - ->where('j_article.article_id','in',$ids) - ->where('j_article.state',0) + ->join('j_journal', 'j_article.journal_id = j_journal.journal_id', 'left') + ->join('j_journal_stage', 'j_article.journal_stage_id = j_journal_stage.journal_stage_id', 'left') + ->where('j_article.article_id', 'in', $ids) + ->where('j_article.state', 0) ->order('j_journal_stage.stage_year desc,j_article.article_id desc') - ->limit($limit_start,$data['pageSize']) + ->limit($limit_start, $data['pageSize']) ->select(); $count = $this->article_obj - ->where('j_article.article_id','in',$ids) - ->where('j_article.state',0) + ->where('j_article.article_id', 'in', $ids) + ->where('j_article.state', 0) ->count(); //获取作者 foreach ($list as $k => $v) { - $stage_info = $this->journal_stage_obj->where('journal_stage_id',$v['journal_stage_id'])->find(); - $journal_info = $this->journal_obj->where('journal_id',$v['journal_id'])->find(); + $stage_info = $this->journal_stage_obj->where('journal_stage_id', $v['journal_stage_id'])->find(); + $journal_info = $this->journal_obj->where('journal_id', $v['journal_id'])->find(); //组合cite信息 $no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):'; - $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi']; - $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(); + $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi']; + $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; $list[$k]['cite'] = $cite; $list[$k]['authortitle'] = $this->getAuthor($v); } + //连续出版判断,决定是否显示出版时间 + foreach ($list as $k => $v) { + $ca_stage = $this->journal_stage_obj->where('journal_stage_id', $v['journal_stage_id'])->find(); + if (($v['journal_id'] == 2 && $ca_stage['stage_year'] >= 2022) || ($v['journal_id'] == 18 && $ca_stage['stage_year'] >= 2022) || ($v['journal_id'] == 17 && $ca_stage['stage_year'] >= 2019)) { + $list[$k]['isShowOtime'] = 1; + } else { + $list[$k]['isShowOtime'] = 0; + } + } + //标题斜体 foreach ($list as $k => $v) { $caches = $this->article_ltai_obj->where('article_id', $v['article_id'])->where('state', 0)->column('content'); @@ -521,15 +538,26 @@ class Journal extends Controller { if ($journal_info['journal_id'] == 22) { $cite = $v['abbr'] . '. ' . $v['title'] . '[J]. ' . $journal_info['jabbr'] . ',' . $stage_info['stage_year'] . ',' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi']; } else { - $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi']; + $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi']; } - $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(); + $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; $list[$k]['cite'] = $cite; $list[$k]['authortitle'] = $this->getAuthor($v); } + //连续出版判断,决定是否显示出版时间 + foreach ($list as $k => $v) { + $ca_stage = $this->journal_stage_obj->where('journal_stage_id', $v['journal_stage_id'])->find(); + if (($v['journal_id'] == 2 && $ca_stage['stage_year'] >= 2022) || ($v['journal_id'] == 18 && $ca_stage['stage_year'] >= 2022) || ($v['journal_id'] == 17 && $ca_stage['stage_year'] >= 2019)) { + $list[$k]['isShowOtime'] = 1; + } else { + $list[$k]['isShowOtime'] = 0; + } + } + + return json(['code' => 0, 'msg' => 'success', 'data' => ['stage' => $stage_info, 'articleList' => $list]]); } @@ -540,14 +568,14 @@ class Journal extends Controller { $frag = ''; foreach ($list as $k => $v) { $ca = ''; - if($v['orcid']!=''){ - $ca = ''; + if ($v['orcid'] != '') { + $ca = ''; } - $frag = $frag == '' ? '' . $v['author_name'].$ca : $frag . ', ' . $v['author_name'].$ca; + $frag = $frag == '' ? '' . $v['author_name'] . $ca : $frag . ', ' . $v['author_name'] . $ca; } return $frag; } - + /** * @title 获取文章作者分布 * @description 获取文章作者分布 @@ -557,33 +585,33 @@ class Journal extends Controller { * * @param name:journal_id type:int require:1 desc:期刊id */ - public function getAuthorFB(){ + public function getAuthorFB() { $data = $this->request->post(); - $stages = $this->journal_stage_obj->where('journal_id',$data['journal_id'])->where('stage_year','>', (intval(date('Y'))-3))->where('state',0)->column('journal_stage_id'); - $articles = $this->article_obj->where('journal_id',$data['journal_id'])->where('journal_stage_id','in',$stages)->where('state',0)->column('article_id'); - $list = $this->article_author_obj->where('article_id','in',$articles)->where('state',0)->select(); + $stages = $this->journal_stage_obj->where('journal_id', $data['journal_id'])->where('stage_year', '>', (intval(date('Y')) - 3))->where('state', 0)->column('journal_stage_id'); + $articles = $this->article_obj->where('journal_id', $data['journal_id'])->where('journal_stage_id', 'in', $stages)->where('state', 0)->column('article_id'); + $list = $this->article_author_obj->where('article_id', 'in', $articles)->where('state', 0)->select(); $frag = []; - foreach ($list as $v){ + foreach ($list as $v) { $frag[$v['author_name']] = $v['author_country']; } $f = []; - foreach ($frag as $val){ - if(isset($f[$val])){ + foreach ($frag as $val) { + if (isset($f[$val])) { $f[$val]++; - }else{ + } else { $f[$val] = 1; } } $res = []; - foreach ($f as $k => $value){ + foreach ($f as $k => $value) { $res[] = array( - 'author_country'=>$k, - 'sum'=>$value + 'author_country' => $k, + 'sum' => $value ); } - for($i=0;$ijournal_stage_obj->where('journal_stage_id', $v['journal_stage_id'])->find(); //组合cite信息 $no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):'; - $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi']; - $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(); + $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi']; + $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; $list[$k]['cite'] = $cite; $list[$k]['authortitle'] = $this->getAuthor($v); } + + //连续出版判断,决定是否显示出版时间 + foreach ($list as $k => $v) { + $ca_stage = $this->journal_stage_obj->where('journal_stage_id', $v['journal_stage_id'])->find(); + if (($v['journal_id'] == 2 && $ca_stage['stage_year'] >= 2022) || ($v['journal_id'] == 18 && $ca_stage['stage_year'] >= 2022) || ($v['journal_id'] == 17 && $ca_stage['stage_year'] >= 2019)) { + $list[$k]['isShowOtime'] = 1; + } else { + $list[$k]['isShowOtime'] = 0; + } + } return json(['code' => 0, 'msg' => 'success', 'data' => ['articlelist' => $list, 'count' => $count]]); } @@ -687,8 +725,8 @@ class Journal extends Controller { $stage_info = $this->journal_stage_obj->where('journal_stage_id', $v['journal_stage_id'])->find(); //组合cite信息 $no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):'; - $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi']; - $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(); + $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi']; + $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; $list[$k]['cite'] = $cite; @@ -704,6 +742,16 @@ class Journal extends Controller { $list[$k]['title'] = $cache_title; } + //连续出版判断,决定是否显示出版时间 + foreach ($list as $k => $v) { + $ca_stage = $this->journal_stage_obj->where('journal_stage_id', $v['journal_stage_id'])->find(); + if (($v['journal_id'] == 2 && $ca_stage['stage_year'] >= 2022) || ($v['journal_id'] == 18 && $ca_stage['stage_year'] >= 2022) || ($v['journal_id'] == 17 && $ca_stage['stage_year'] >= 2019)) { + $list[$k]['isShowOtime'] = 1; + } else { + $list[$k]['isShowOtime'] = 0; + } + } + return json(['code' => 0, 'msg' => 'success', 'data' => ['articlelist' => $list]]); } @@ -740,19 +788,32 @@ class Journal extends Controller { ->where('j_article.state', 0) ->where('j_journal_stage.is_publish', 1) ->count(); + + if($count>50){//只显示前50片 + $count = 50; + } //获取作者 foreach ($list as $k => $v) { $stage_info = $this->journal_stage_obj->where('journal_stage_id', $v['journal_stage_id'])->find(); //组合cite信息 $no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):'; - $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi']; - $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(); + $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi']; + $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; $list[$k]['cite'] = $cite; $list[$k]['authortitle'] = $this->getAuthor($v); } + //连续出版判断,决定是否显示出版时间 + foreach ($list as $k => $v){ + $ca_stage = $this->journal_stage_obj->where('journal_stage_id',$v['journal_stage_id'])->find(); + if(($v['journal_id']==2&&$ca_stage['stage_year']>=2022)||($v['journal_id']==18&&$ca_stage['stage_year']>=2022)||($v['journal_id']==17&&$ca_stage['stage_year']>=2019)){ + $list[$k]['isShowOtime'] = 1; + }else{ + $list[$k]['isShowOtime'] = 0; + } + } //标题斜体 foreach ($list as $k => $v) { @@ -832,8 +893,8 @@ class Journal extends Controller { $stage_info = $this->journal_stage_obj->where('journal_stage_id', $v['journal_stage_id'])->find(); //组合cite信息 $no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):'; - $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi']; - $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(); + $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi']; + $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; $list[$k]['cite'] = $cite; @@ -848,6 +909,15 @@ class Journal extends Controller { } $list[$k]['title'] = $cache_title; } + //连续出版判断,决定是否显示出版时间 + foreach ($list as $k => $v) { + $ca_stage = $this->journal_stage_obj->where('journal_stage_id', $v['journal_stage_id'])->find(); + if (($v['journal_id'] == 2 && $ca_stage['stage_year'] >= 2022) || ($v['journal_id'] == 18 && $ca_stage['stage_year'] >= 2022) || ($v['journal_id'] == 17 && $ca_stage['stage_year'] >= 2019)) { + $list[$k]['isShowOtime'] = 1; + } else { + $list[$k]['isShowOtime'] = 0; + } + } return jsonSuccess(['topic_info' => $topic_info, 'articlelist' => $list]); } else { @@ -1013,34 +1083,32 @@ class Journal extends Controller { $re['topics'] = $list; return jsonSuccess($re); } - - public function tttt(){ - $host="localhost";//mysql服务器地址 - $user='root'; - $pass='root'; - $dbName='journal';//数据可名称 - $charSet='utf8'; - $port='3306'; - $conn=mysql_connect($host,$user,$padd); - if(!$conn){ - echo 'unable to connect to DB '.mysql_error(); - exit(); - } - query('use '.$db); + + public function tttt() { + $host = "localhost"; //mysql服务器地址 + $user = 'root'; + $pass = 'root'; + $dbName = 'journal'; //数据可名称 + $charSet = 'utf8'; + $port = '3306'; + $conn = mysql_connect($host, $user, $padd); + if (!$conn) { + echo 'unable to connect to DB ' . mysql_error(); + exit(); + } + query('use ' . $db); - $sql = "select * from j_user limit 1";//这里是sql语句 + $sql = "select * from j_user limit 1"; //这里是sql语句 - $res = getAll($sql); + $res = getAll($sql); - echo '
';
-		  var_dump($res);
-		  echo '
'; + echo '
';
+        var_dump($res);
+        echo '
'; } - - /** * @title 添加期刊订阅 @@ -1066,7 +1134,7 @@ class Journal extends Controller { $insert['journal_id'] = $data['journal_id']; $insert['email'] = $data['email']; $id = $this->subscribe_journal_obj->insertGetId($insert); - $journal_info = $this->journal_obj->where("journal_id",$data['journal_id'])->find(); + $journal_info = $this->journal_obj->where("journal_id", $data['journal_id'])->find(); //发送邮件感谢 $tt = 'Dear Researcher,

'; $tt .= 'Welcome you to the email alert for the latest research and more. Thank you for your interest in our publications and topics.
'; @@ -1076,7 +1144,7 @@ class Journal extends Controller { $tt .= 'Email: publisher@tmrjournals.com'; $tt .= 'www.tmrjournals.com'; $maidata['email'] = $data['email']; - $maidata['title'] = $journal_info['title']." ISSN ".$journal_info['issn'];//'Traditional Medicine Research ISSN 2413-3973'; + $maidata['title'] = $journal_info['title'] . " ISSN " . $journal_info['issn']; //'Traditional Medicine Research ISSN 2413-3973'; $maidata['content'] = $tt; $maidata['tmail'] = 'publicrelations@tmrjournals.com'; $maidata['tpassword'] = 'pRWU999999'; @@ -1084,7 +1152,7 @@ class Journal extends Controller { return jsonSuccess([]); } - + /** * @title 添加期刊订阅通过issn * @description 添加期刊订阅通过issn @@ -1095,9 +1163,9 @@ class Journal extends Controller { * @param name:issn type:string require:1 desc:issn号 * @param name:email type:string require:1 desc:邮件地址 */ - public function addSubscribeByIssn(){ + public function addSubscribeByIssn() { $data = $this->request->post(); - $journal_info = $this->journal_obj->where('issn',$data['issn'])->find(); + $journal_info = $this->journal_obj->where('issn', $data['issn'])->find(); //去重 $repeat = $this->subscribe_journal_obj ->where('journal_id', $journal_info['journal_id']) @@ -1119,7 +1187,7 @@ class Journal extends Controller { $tt .= 'Email: publisher@tmrjournals.com'; $tt .= 'www.tmrjournals.com'; $maidata['email'] = $data['email']; - $maidata['title'] = $journal_info['title']." ISSN ".$journal_info['issn'];//'Traditional Medicine Research ISSN 2413-3973'; + $maidata['title'] = $journal_info['title'] . " ISSN " . $journal_info['issn']; //'Traditional Medicine Research ISSN 2413-3973'; $maidata['content'] = $tt; $maidata['tmail'] = 'publicrelations@tmrjournals.com'; $maidata['tpassword'] = 'pRWU999999'; @@ -1127,15 +1195,15 @@ class Journal extends Controller { return jsonSuccess([]); } - - public function pushEmail(){ + + public function pushEmail() { die; - $list = $this->subscribe_journal_obj->where('journal_id',1)->select(); - + $list = $this->subscribe_journal_obj->where('journal_id', 1)->select(); + // $a = []; // $a[] = ['email'=>'751475802@qq.com']; // $a[] = ['email'=>'13662001490@126.com']; - foreach ($list as $v){ + foreach ($list as $v) { $tt = 'Dear Researcher,

'; $tt .= 'We are so kindly to  bring you a notice that we are glad to invite eminent people as the Reviewer for Traditional Medicine Research (ISSN 2413-3973).

'; $tt .= 'Traditional Medicine Research has been included in Emerging Sources Citation Index (ESCI), Embase, DOAJ, ProQuest, J-Gate, EuroPub, WHO-COVID-19 Database, Google Scholar, EBSCO, ect.

'; @@ -1154,7 +1222,7 @@ class Journal extends Controller { Queue::push('app\api\job\mail@fire', $maidata, "mail"); } } - + /** * @title 获取期刊主页分期信息 * @description 获取期刊主页分期信息 @@ -1166,16 +1234,16 @@ class Journal extends Controller { * * @return stages:分期信息# */ - public function getMainPageStages(){ + public function getMainPageStages() { $data = $this->request->post(); - $frag=[]; - $list = $this->journal_stage_obj->where('journal_id',$data['journal_id'])->where('stage_year', date("Y"))->where('is_publish',1)->where('state',0)->order("stage_no desc")->select(); - if(count($list)==0){ - $frag = $this->journal_stage_obj->where('journal_id',$data['journal_id'])->where('stage_year', date("Y",strtotime("-1 year")))->where('is_publish',1)->where('state',0)->order("stage_no desc")->select(); - }else{ + $frag = []; + $list = $this->journal_stage_obj->where('journal_id', $data['journal_id'])->where('stage_year', date("Y"))->where('is_publish', 1)->where('state', 0)->order("stage_no desc")->select(); + if (count($list) == 0) { + $frag = $this->journal_stage_obj->where('journal_id', $data['journal_id'])->where('stage_year', date("Y", strtotime("-1 year")))->where('is_publish', 1)->where('state', 0)->order("stage_no desc")->select(); + } else { $frag = $list; } - + $re['stages'] = $frag; return jsonSuccess($re); } @@ -1208,10 +1276,10 @@ class Journal extends Controller { $insert['topic_id'] = $v; $insert['email'] = $data['email']; $id = $this->subscribe_topic_obj->insertGetId($insert); - $cache_info = $this->journal_topic_obj->where('journal_topic_id',$v)->find(); - $str .= 'Unsubscribe topic->'.$cache_info['title'].'
'; + $cache_info = $this->journal_topic_obj->where('journal_topic_id', $v)->find(); + $str .= 'Unsubscribe topic->' . $cache_info['title'] . '
'; } - if($str==''){ + if ($str == '') { return jsonError('repeat subscribe!'); } //发送邮件感谢 @@ -1271,7 +1339,7 @@ class Journal extends Controller { $res = Queue::push('app\api\job\mail@fire', $maidata, "mail"); return jsonSuccess([]); } - + /** * @title 添加通用话题订阅 * @description 添加通用话题订阅 @@ -1282,7 +1350,7 @@ class Journal extends Controller { * @param name:base_topic_id type:int require:1 desc:期刊话题id * @param name:email type:string require:1 desc:邮箱地址 */ - public function addSubscribeBaseTopic(){ + public function addSubscribeBaseTopic() { $data = $this->request->post(); //去重 $repeat = $this->subscribe_base_topic_obj @@ -1312,14 +1380,14 @@ class Journal extends Controller { Queue::push('app\api\job\mail@fire', $maidata, "mail"); return jsonSuccess([]); } - + public function UnsubscribeTopic($snum) { $this->subscribe_topic_obj->where('subscribe_topic_id', $snum)->update(['state' => 1]); echo 'Unsubscribe successfully!'; } - - public function UnsubscribeBaseTopic($snum){ - $this->subscribe_base_topic_obj->where('subscribe_base_topic_id',$snum)->update(['state'=>1]); + + public function UnsubscribeBaseTopic($snum) { + $this->subscribe_base_topic_obj->where('subscribe_base_topic_id', $snum)->update(['state' => 1]); echo 'Unsubscribe successfully!'; } @@ -1362,7 +1430,7 @@ class Journal extends Controller { public function searchArticle() { $data = $this->request->post(); $limit_start = ($data['pageIndex'] - 1) * $data['pageSize']; - $arts = $this->article_author_obj->where('state', 0)->where("author_name like '%" . str_replace("'","''",trim($data['keyword'])) . "%'")->column('article_id'); + $arts = $this->article_author_obj->where('state', 0)->where("author_name like '%" . str_replace("'", "''", trim($data['keyword'])) . "%'")->column('article_id'); $list = $this->article_obj ->where('journal_id', $data['journal_id']) ->where('state', 0) @@ -1370,9 +1438,9 @@ class Journal extends Controller { // ->where('title like "%' . str_replace("'","''",trim($data['keyword'])) . '%" or abstract like "%' . str_replace("'","''",trim($data['keyword'])) . '%" or keywords like "%' . str_replace("'","''",trim($data['keyword'])) . '%"') ->where(function($query)use($arts, $data) { $query->where('article_id', 'in', $arts) - ->whereOr("`title` like '%" . str_replace("'","''",trim($data['keyword'])) . "%' or `abstract` like '%" . str_replace("'","''",trim($data['keyword'])) . "%' or `keywords` like '%" . str_replace("'","''",trim($data['keyword'])) . "%'"); + ->whereOr("`title` like '%" . str_replace("'", "''", trim($data['keyword'])) . "%' or `abstract` like '%" . str_replace("'", "''", trim($data['keyword'])) . "%' or `keywords` like '%" . str_replace("'", "''", trim($data['keyword'])) . "%'"); }) - ->orderRaw("(CASE WHEN title LIKE '%" . str_replace("'","''",trim($data['keyword'])) . "%' THEN 1 ELSE 0 END) desc") + ->orderRaw("(CASE WHEN title LIKE '%" . str_replace("'", "''", trim($data['keyword'])) . "%' THEN 1 ELSE 0 END) desc") ->limit($limit_start, $data['pageSize']) ->select(); $count = $this->article_obj @@ -1380,7 +1448,7 @@ class Journal extends Controller { ->where('state', 0) ->where(function($query)use($arts, $data) { $query->where('article_id', 'in', $arts) - ->whereOr('title|abstract|keywords', 'like', '%' . str_replace("'","''",trim($data['keyword'])) . '%'); + ->whereOr('title|abstract|keywords', 'like', '%' . str_replace("'", "''", trim($data['keyword'])) . '%'); }) ->count(); @@ -1393,8 +1461,8 @@ class Journal extends Controller { $list[$k]['stage'] = $stage_info; //组合cite信息 $no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):'; - $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi']; - $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(); + $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi']; + $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; $list[$k]['cite'] = $cite; @@ -1455,8 +1523,8 @@ class Journal extends Controller { $list[$k]['journal'] = $journal_info; //组合cite信息 $no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):'; - $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi']; - $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(); + $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi']; + $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; $list[$k]['cite'] = $cite; @@ -1474,7 +1542,7 @@ class Journal extends Controller { $re['count'] = $count; return jsonSuccess($re); } - + /** * @title 编委国际化 * @description 编委国际化 @@ -1502,7 +1570,6 @@ class Journal extends Controller { $re['country'] = $frag; return jsonSuccess($re); } - /** * @title 查找文章精确查找 @@ -1590,7 +1657,7 @@ class Journal extends Controller { $list[$k]['journal'] = $journal_info; //组合cite信息 $no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):'; - $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi']; + $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi']; $list[$k]['cite'] = $cite; $list[$k]['authortitle'] = $this->getAuthor($v); //斜体变红 @@ -1689,8 +1756,8 @@ class Journal extends Controller { $list[$k]['journal'] = $journal_info; //组合cite信息 $no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):'; - $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi']; - $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(); + $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi']; + $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; $list[$k]['cite'] = $cite; diff --git a/application/api/controller/Main.php b/application/api/controller/Main.php index 820b536..7f4d2af 100644 --- a/application/api/controller/Main.php +++ b/application/api/controller/Main.php @@ -54,6 +54,11 @@ class Main extends Controller { // return jsonSuccess(['aa'=>'wjl']); echo md5("S123456pnx"); } + + + public function mddd(){ + echo md5("zhu18920435065"); + } /** * @title 获取scients @@ -188,6 +193,17 @@ class Main extends Controller { } $list[$k]['title'] = $cache_title; } + + //连续出版判断,决定是否显示出版时间 + foreach ($list as $k => $v){ + $ca_stage = $this->journal_stage_obj->where('journal_stage_id',$v['journal_stage_id'])->find(); + if(($v['journal_id']==2&&$ca_stage['stage_year']>=2022)||($v['journal_id']==18&&$ca_stage['stage_year']>=2022)||($v['journal_id']==17&&$ca_stage['stage_year']>=2019)){ + $list[$k]['isShowOtime'] = 1; + }else{ + $list[$k]['isShowOtime'] = 0; + } + } + // foreach ($list as $k => $v) { // $list[$k]['authortitle'] = $this->getAuthor($v); // } @@ -281,6 +297,15 @@ class Main extends Controller { } $list[$k]['title'] = $cache_title; } + //连续出版判断,决定是否显示出版时间 + foreach ($list as $k => $v){ + $ca_stage = $this->journal_stage_obj->where('journal_stage_id',$v['journal_stage_id'])->find(); + if(($v['journal_id']==2&&$ca_stage['stage_year']>=2022)||($v['journal_id']==18&&$ca_stage['stage_year']>=2022)||($v['journal_id']==17&&$ca_stage['stage_year']>=2019)){ + $list[$k]['isShowOtime'] = 1; + }else{ + $list[$k]['isShowOtime'] = 0; + } + } $re['articles'] = $list; return jsonSuccess($re); } @@ -361,7 +386,7 @@ class Main extends Controller { // $push_url = 'http://www.journal.com/api/Main/getImgFile'; //定义需要查询同化的数组 - $list = ['articleCite','articlePDF','articleicon','articleSUB','articleSUB2','baseTopic','journalCfp','journalfooter','journalicon','journalline','rotation','journaltopic','specialIcon','system','articleCDF']; + $list = ['articleCite','articlePDF','articleicon','articleSUB','boardIcon','articleSUB2','baseTopic','journalCfp','journalfooter','journalicon','journalline','rotation','journaltopic','specialIcon','system','articleCDF']; foreach ($list as $v){ $dir = $root_url."public/".$v."/".date('Ymd'); diff --git a/application/master/controller/Journal.php b/application/master/controller/Journal.php index 56f3511..d84cebf 100644 --- a/application/master/controller/Journal.php +++ b/application/master/controller/Journal.php @@ -148,6 +148,7 @@ class Journal extends Controller { $insert_data['editor_id'] = $data['editor_id']; $insert_data['system_color'] = $data['system_color']; $insert_data['submission_url'] = $data['submission_url']; + $insert_data['board_url'] = $data['board_url']; $res = $this->journal_obj->insert($insert_data); if($res){ return json(['code'=>0,'msg'=>'success']); @@ -225,6 +226,7 @@ class Journal extends Controller { $insert_data['editor_id'] = $data['editor_id']; $insert_data['system_color'] = $data['system_color']; $insert_data['submission_url'] = $data['submission_url']; + $insert_data['board_url'] = $data['board_url']; $res = $this->journal_obj->where('journal_id',$data['journal_id'])->update($insert_data); // if($res){ return json(['code'=>0,'msg'=>'success']); @@ -378,6 +380,8 @@ class Journal extends Controller { * @param name:website type:string require:1 desc:个人主页地址 * @param name:dr type:string require:1 desc:学位 * @param name:title type:string require:1 desc:职称 + * @param name:field type:string require:1 desc:领域描述 + * @param name:board_icon type:string require:1 desc:编委头像地址 * @param name:address type:string require:1 desc:单位 * @param name:country type:string require:1 desc:国家 * @param name:board_group_id type:int require:1 desc:编委分组id @@ -386,12 +390,14 @@ class Journal extends Controller { $data = $this->request->post(); $insert['journal_id'] = $data['journal_id']; $insert['type'] = $data['type']; - $insert['name'] = $data['name']; - $insert['website'] = $data['website']; + $insert['name'] = trim($data['name']); + $insert['website'] = trim($data['website']); $insert['dr'] = $data['dr']; + $insert['field'] = trim($data['field']); $insert['title'] = $data['title']; - $insert['address'] = $data['address']; - $insert['country'] = $data['country']; + $insert['address'] = trim($data['address']); + $insert['country'] = trim($data['country']); + $insert['board_icon'] = trim($data['board_icon']); $insert['board_group_id'] = $data['board_group_id']; $this->board_obj->insert($insert); return jsonSuccess([]); @@ -425,18 +431,22 @@ class Journal extends Controller { * @param name:website type:string require:1 desc:个人主页地址 * @param name:dr type:string require:1 desc:学位 * @param name:title type:string require:1 desc:职称 + * @param name:field type:string require:1 desc:领域描述 * @param name:address type:string require:1 desc:单位 + * @param name:board_icon type:string require:1 desc:编委头像 * @param name:country type:string require:1 desc:国家 * @param name:board_group_id type:int require:1 desc:编委分组id */ public function editBoard(){ $data = $this->request->post(); $insert['type'] = $data['type']; - $insert['name'] = $data['name']; - $insert['website'] = $data['website']; + $insert['name'] = trim($data['name']); + $insert['website'] = trim($data['website']); $insert['dr'] = $data['dr']; - $insert['title'] = $data['title']; - $insert['address'] = $data['address']; + $insert['title'] = trim($data['title']); + $insert['field'] = trim($data['field']); + $insert['address'] = trim($data['address']); + $insert['board_icon'] = trim($data['board_icon']); $insert['country'] = $data['country']; $insert['board_group_id'] = $data['board_group_id']; @@ -930,6 +940,30 @@ class Journal extends Controller { } } + + /** + * @title 编委头像上传 + * @description 编委头像上传 + * @author wangjinlei + * @url /master/Journal/up_board_file + * @method POST + * + * @param name:name type:string require:1 default:boardIcon desc:文件域名称 + * + * @return upurl:图片地址 + */ + public function up_board_file() { + $file = request()->file('boardIcon'); + if ($file) { + $info = $file->move(ROOT_PATH . 'public' . DS . 'boardIcon'); + if ($info) { + return json(['code'=>0 , 'msg'=>'success', 'upurl' => str_replace("\\", "/", $info->getSaveName())]); + } else { + return json(['code' => 1, 'msg' => $file->getError()]); + } + } + } + /** * @title line图片上传 * @description line图片上传