20201112
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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'] . '. <i>' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '</i>. ' . $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'] . '. <i>' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '</i>. ' . $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'] . '. <i>' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '</i>. ' . $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'] . '. <i>' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '</i>. ' . $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,25 +538,25 @@ 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'] . '. <i>' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '</i>. ' . $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)){
|
||||
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{
|
||||
} else {
|
||||
$list[$k]['isShowOtime'] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return json(['code' => 0, 'msg' => 'success', 'data' => ['stage' => $stage_info, 'articleList' => $list]]);
|
||||
}
|
||||
@@ -551,14 +568,14 @@ class Journal extends Controller {
|
||||
$frag = '';
|
||||
foreach ($list as $k => $v) {
|
||||
$ca = '';
|
||||
if($v['orcid']!=''){
|
||||
$ca = '<a href="https://orcid.org/'.$v['orcid'].'" target="_blank"><img src="img/or_id.png" alt="" style="width: 13px;margin-left: 3px;"></a>';
|
||||
if ($v['orcid'] != '') {
|
||||
$ca = '<a href="https://orcid.org/' . $v['orcid'] . '" target="_blank"><img src="img/or_id.png" alt="" style="width: 13px;margin-left: 3px;"></a>';
|
||||
}
|
||||
$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 获取文章作者分布
|
||||
@@ -568,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;$i<count($res);$i++){
|
||||
for ($j = $i+1; $j < count($res); $j++) {
|
||||
if($res[$i]['sum']<$res[$j]['sum']){
|
||||
for ($i = 0; $i < count($res); $i++) {
|
||||
for ($j = $i + 1; $j < count($res); $j++) {
|
||||
if ($res[$i]['sum'] < $res[$j]['sum']) {
|
||||
$tem = $res[$i]; // 这里临时变量,存贮$i的值
|
||||
$res[$i] = $res[$j]; // 第一次更换位置
|
||||
$res[$j] = $tem; // 完成位置互换
|
||||
@@ -659,13 +676,23 @@ 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'] . '. <i>' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '</i>. ' . $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'] . '. <i>' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '</i>. ' . $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]]);
|
||||
}
|
||||
|
||||
@@ -698,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'] . '. <i>' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '</i>. ' . $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'] . '. <i>' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '</i>. ' . $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;
|
||||
@@ -715,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]]);
|
||||
}
|
||||
|
||||
@@ -757,13 +794,22 @@ 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'] . '. <i>' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '</i>. ' . $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'] . '. <i>' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '</i>. ' . $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) {
|
||||
@@ -843,8 +889,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'] . '. <i>' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '</i>. ' . $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'] . '. <i>' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '</i>. ' . $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;
|
||||
@@ -859,6 +905,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 {
|
||||
@@ -1024,34 +1079,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 '<pre>';
|
||||
var_dump($res);
|
||||
echo '</pre>';
|
||||
echo '<pre>';
|
||||
var_dump($res);
|
||||
echo '</pre>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @title 添加期刊订阅
|
||||
@@ -1077,7 +1130,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,<br><br>';
|
||||
$tt .= 'Welcome you to the email alert for the latest research and more. Thank you for your interest in our publications and topics.<br>';
|
||||
@@ -1087,7 +1140,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';
|
||||
@@ -1095,7 +1148,7 @@ class Journal extends Controller {
|
||||
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @title 添加期刊订阅通过issn
|
||||
* @description 添加期刊订阅通过issn
|
||||
@@ -1106,9 +1159,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'])
|
||||
@@ -1130,7 +1183,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';
|
||||
@@ -1138,15 +1191,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,<br><br>';
|
||||
$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).<br><br>';
|
||||
$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.<br><br>';
|
||||
@@ -1165,7 +1218,7 @@ class Journal extends Controller {
|
||||
Queue::push('app\api\job\mail@fire', $maidata, "mail");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @title 获取期刊主页分期信息
|
||||
* @description 获取期刊主页分期信息
|
||||
@@ -1177,16 +1230,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);
|
||||
}
|
||||
@@ -1219,10 +1272,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 .= '<a href="http://journalapi.tmrjournals.com/public/index.php/api/Journal/UnsubscribeTopic/snum/' . $id . '">Unsubscribe topic->'.$cache_info['title'].'</a><br>';
|
||||
$cache_info = $this->journal_topic_obj->where('journal_topic_id', $v)->find();
|
||||
$str .= '<a href="http://journalapi.tmrjournals.com/public/index.php/api/Journal/UnsubscribeTopic/snum/' . $id . '">Unsubscribe topic->' . $cache_info['title'] . '</a><br>';
|
||||
}
|
||||
if($str==''){
|
||||
if ($str == '') {
|
||||
return jsonError('repeat subscribe!');
|
||||
}
|
||||
//发送邮件感谢
|
||||
@@ -1282,7 +1335,7 @@ class Journal extends Controller {
|
||||
$res = Queue::push('app\api\job\mail@fire', $maidata, "mail");
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @title 添加通用话题订阅
|
||||
* @description 添加通用话题订阅
|
||||
@@ -1293,7 +1346,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
|
||||
@@ -1323,14 +1376,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!';
|
||||
}
|
||||
|
||||
@@ -1373,7 +1426,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)
|
||||
@@ -1381,9 +1434,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
|
||||
@@ -1391,7 +1444,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();
|
||||
|
||||
@@ -1404,8 +1457,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'] . '. <i>' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '</i>. ' . $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'] . '. <i>' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '</i>. ' . $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;
|
||||
@@ -1466,8 +1519,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'] . '. <i>' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '</i>. ' . $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'] . '. <i>' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '</i>. ' . $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;
|
||||
@@ -1485,7 +1538,7 @@ class Journal extends Controller {
|
||||
$re['count'] = $count;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @title 编委国际化
|
||||
* @description 编委国际化
|
||||
@@ -1513,7 +1566,6 @@ class Journal extends Controller {
|
||||
$re['country'] = $frag;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @title 查找文章精确查找
|
||||
@@ -1601,7 +1653,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'] . '. <i>' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||
$list[$k]['cite'] = $cite;
|
||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||
//斜体变红
|
||||
@@ -1700,8 +1752,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'] . '. <i>' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '</i>. ' . $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'] . '. <i>' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '</i>. ' . $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;
|
||||
|
||||
@@ -193,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);
|
||||
// }
|
||||
@@ -286,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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user