20201112
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace app\api\controller;
|
namespace app\api\controller;
|
||||||
|
|
||||||
use think\Controller;
|
use think\Controller;
|
||||||
@@ -9,13 +10,15 @@ use think\Db;
|
|||||||
* @description 文章web相关操作
|
* @description 文章web相关操作
|
||||||
* @group 文章web相关
|
* @group 文章web相关
|
||||||
*/
|
*/
|
||||||
class Article extends Controller{
|
class Article extends Controller {
|
||||||
|
|
||||||
//put your code here
|
//put your code here
|
||||||
protected $admin_obj = '';
|
protected $admin_obj = '';
|
||||||
protected $journal_obj = '';
|
protected $journal_obj = '';
|
||||||
protected $article_obj = '';
|
protected $article_obj = '';
|
||||||
protected $article_author_obj = '';
|
protected $article_author_obj = '';
|
||||||
protected $article_organ_obj = '';
|
protected $article_organ_obj = '';
|
||||||
|
protected $article_ltai_obj = '';
|
||||||
protected $article_author_to_organ_obj = '';
|
protected $article_author_to_organ_obj = '';
|
||||||
protected $journal_topic_obj = '';
|
protected $journal_topic_obj = '';
|
||||||
protected $journal_stage_obj = '';
|
protected $journal_stage_obj = '';
|
||||||
@@ -30,6 +33,7 @@ class Article extends Controller{
|
|||||||
$this->article_obj = Db::name('article');
|
$this->article_obj = Db::name('article');
|
||||||
$this->article_author_obj = Db::name('article_author');
|
$this->article_author_obj = Db::name('article_author');
|
||||||
$this->article_organ_obj = Db::name('article_organ');
|
$this->article_organ_obj = Db::name('article_organ');
|
||||||
|
$this->article_ltai_obj = Db::name('article_ltai');
|
||||||
$this->article_author_to_organ_obj = Db::name('article_author_to_organ');
|
$this->article_author_to_organ_obj = Db::name('article_author_to_organ');
|
||||||
$this->journal_topic_obj = Db::name('journal_topic');
|
$this->journal_topic_obj = Db::name('journal_topic');
|
||||||
$this->journal_stage_obj = Db::name('journal_stage');
|
$this->journal_stage_obj = Db::name('journal_stage');
|
||||||
@@ -37,7 +41,7 @@ class Article extends Controller{
|
|||||||
$this->journal_abs_obj = Db::name('journal_abstracting');
|
$this->journal_abs_obj = Db::name('journal_abstracting');
|
||||||
$this->article_to_topic_obj = Db::name('article_to_topic');
|
$this->article_to_topic_obj = Db::name('article_to_topic');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 获取文章详情
|
* @title 获取文章详情
|
||||||
* @description 获取文章详情
|
* @description 获取文章详情
|
||||||
@@ -54,25 +58,25 @@ class Article extends Controller{
|
|||||||
* @return cite:引用#
|
* @return cite:引用#
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function getArticleDetail(){
|
public function getArticleDetail() {
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
$article_info = $this->article_obj->where('article_id',$data['article_id'])->find();
|
$article_info = $this->article_obj->where('article_id', $data['article_id'])->find();
|
||||||
$journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find();
|
$journal_info = $this->journal_obj->where('journal_id', $article_info['journal_id'])->find();
|
||||||
$stage_info = $this->journal_stage_obj->where('journal_stage_id',$article_info['journal_stage_id'])->find();
|
$stage_info = $this->journal_stage_obj->where('journal_stage_id', $article_info['journal_stage_id'])->find();
|
||||||
|
|
||||||
//获取文章作者相关
|
//获取文章作者相关
|
||||||
$authors = $this->article_author_obj->where('article_id',$article_info['article_id'])->where('state',0)->select();
|
$authors = $this->article_author_obj->where('article_id', $article_info['article_id'])->where('state', 0)->select();
|
||||||
$organs = $this->article_organ_obj->where('article_id',$article_info['article_id'])->where('state',0)->select();
|
$organs = $this->article_organ_obj->where('article_id', $article_info['article_id'])->where('state', 0)->select();
|
||||||
$atto = $this->article_author_to_organ_obj->where('article_id',$article_info['article_id'])->where('state',0)->select();
|
$atto = $this->article_author_to_organ_obj->where('article_id', $article_info['article_id'])->where('state', 0)->select();
|
||||||
$author = $this->sys_author($authors,$organs,$atto);
|
$author = $this->sys_author($authors, $organs, $atto);
|
||||||
|
|
||||||
//组合cite信息
|
//组合cite信息
|
||||||
$no = $stage_info['stage_no']==0?':':'('.$stage_info['stage_no'].'):';
|
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||||
$cite = $article_info['abbr'].'. '.$article_info['title'].'. <i>'.$journal_info['jabbr'].'</i>. '.$stage_info['stage_year'].';'.$stage_info['stage_vol'].$no.$article_info['npp'].'. doi:'.$article_info['doi'];
|
$cite = $article_info['abbr'] . '. ' . $article_info['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $article_info['npp'] . '. doi:' . $article_info['doi'];
|
||||||
|
|
||||||
//修改keywords
|
//修改keywords
|
||||||
$article_info['keywords'] = str_replace(',',' ', $article_info['keywords']);
|
$article_info['keywords'] = str_replace(',', ' ', $article_info['keywords']);
|
||||||
|
|
||||||
//返回数据
|
//返回数据
|
||||||
$re['articleInfo'] = $article_info;
|
$re['articleInfo'] = $article_info;
|
||||||
$re['journalInfo'] = $journal_info;
|
$re['journalInfo'] = $journal_info;
|
||||||
@@ -81,23 +85,24 @@ class Article extends Controller{
|
|||||||
$re['cite'] = $cite;
|
$re['cite'] = $cite;
|
||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
}
|
}
|
||||||
private function sys_author($authors,$organs,$atto){
|
|
||||||
|
private function sys_author($authors, $organs, $atto) {
|
||||||
$cache = [];
|
$cache = [];
|
||||||
foreach ($organs as $k => $v){
|
foreach ($organs as $k => $v) {
|
||||||
$cache[$v['article_organ_id']] = $k+1;
|
$cache[$v['article_organ_id']] = $k + 1;
|
||||||
$organs[$k]['alias'] = $k+1;
|
$organs[$k]['alias'] = $k + 1;
|
||||||
}
|
}
|
||||||
foreach ($authors as $key => $val){
|
foreach ($authors as $key => $val) {
|
||||||
$authors[$key]['ors'] = '';
|
$authors[$key]['ors'] = '';
|
||||||
foreach ($atto as $vv){
|
foreach ($atto as $vv) {
|
||||||
if($vv['article_author_id']==$val['article_author_id']){
|
if ($vv['article_author_id'] == $val['article_author_id']) {
|
||||||
$authors[$key]['ors'] = $authors[$key]['ors']==''?''.$cache[$vv['article_organ_id']]:$authors[$key]['ors'].', '.$cache[$vv['article_organ_id']];
|
$authors[$key]['ors'] = $authors[$key]['ors'] == '' ? '' . $cache[$vv['article_organ_id']] : $authors[$key]['ors'] . ', ' . $cache[$vv['article_organ_id']];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ['authors'=>$authors,'organs'=>$organs];
|
return ['authors' => $authors, 'organs' => $organs];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 获取话题文章列表
|
* @title 获取话题文章列表
|
||||||
* @description 获取话题文章列表
|
* @description 获取话题文章列表
|
||||||
@@ -111,32 +116,44 @@ class Article extends Controller{
|
|||||||
* @return articleList:文章信息#
|
* @return articleList:文章信息#
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function getTopicArticles(){
|
public function getTopicArticles() {
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
$topic_info = $this->journal_topic_obj->where('journal_topic_id',$data['topic_id'])->find();
|
$topic_info = $this->journal_topic_obj->where('journal_topic_id', $data['topic_id'])->find();
|
||||||
$list = $this->article_to_topic_obj->field('j_article.*,j_journal_stage.*')
|
$list = $this->article_to_topic_obj->field('j_article.*,j_journal_stage.*')
|
||||||
->join(array(['j_article','j_article_to_topic.article_id = j_article.article_id','LEFT'],['j_journal_stage','j_article.journal_stage_id = j_journal_stage.journal_stage_id','LEFT']))
|
->join(array(['j_article', 'j_article_to_topic.article_id = j_article.article_id', 'LEFT'], ['j_journal_stage', 'j_article.journal_stage_id = j_journal_stage.journal_stage_id', 'LEFT']))
|
||||||
->where('j_article_to_topic.topic_id',$data['topic_id'])
|
->where('j_article_to_topic.topic_id', $data['topic_id'])
|
||||||
->where('j_article_to_topic.state',0)
|
->where('j_article_to_topic.state', 0)
|
||||||
->select();
|
->select();
|
||||||
//获取作者
|
//获取作者
|
||||||
foreach($list as $k=>$v){
|
foreach ($list as $k => $v) {
|
||||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||||
}
|
}
|
||||||
|
//标题斜体
|
||||||
|
foreach ($list as $k => $v) {
|
||||||
|
$caches = $this->article_ltai_obj->where('article_id', $v['article_id'])->where('state', 0)->column('content');
|
||||||
|
$cache_title = $v['title'];
|
||||||
|
foreach ($caches as $val) {
|
||||||
|
$cache_title = str_replace($val, '<i>' . $val . '</i>', $cache_title);
|
||||||
|
}
|
||||||
|
$list[$k]['title'] = $cache_title;
|
||||||
|
}
|
||||||
|
|
||||||
$re['topicInfo'] = $topic_info;
|
$re['topicInfo'] = $topic_info;
|
||||||
$re['articleList'] = $list;
|
$re['articleList'] = $list;
|
||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
}
|
}
|
||||||
private function getAuthor($article){
|
|
||||||
|
private function getAuthor($article) {
|
||||||
$where['article_id'] = $article['article_id'];
|
$where['article_id'] = $article['article_id'];
|
||||||
$where['state'] = 0;
|
$where['state'] = 0;
|
||||||
$list = $this->article_author_obj->where($where)->select();
|
$list = $this->article_author_obj->where($where)->select();
|
||||||
$frag = '';
|
$frag = '';
|
||||||
foreach ($list as $k=>$v){
|
foreach ($list as $k => $v) {
|
||||||
$frag = $frag==''?''.$v['author_name']:$frag.', '.$v['author_name'];
|
$frag = $frag == '' ? '' . $v['author_name'] : $frag . ', ' . $v['author_name'];
|
||||||
}
|
}
|
||||||
return $frag;
|
return $frag;
|
||||||
}
|
}
|
||||||
|
|
||||||
// private function getAuthor($article){
|
// private function getAuthor($article){
|
||||||
// $where['article_id'] = $article['article_id'];
|
// $where['article_id'] = $article['article_id'];
|
||||||
// $where['state'] = 0;
|
// $where['state'] = 0;
|
||||||
@@ -147,8 +164,7 @@ class Article extends Controller{
|
|||||||
// }
|
// }
|
||||||
// return substr($frag,0, -1);
|
// return substr($frag,0, -1);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 获取stage文章列表
|
* @title 获取stage文章列表
|
||||||
* @description 获取stage文章列表
|
* @description 获取stage文章列表
|
||||||
@@ -162,25 +178,29 @@ class Article extends Controller{
|
|||||||
* @return articleList:文章信息#
|
* @return articleList:文章信息#
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function getStageArticles(){
|
public function getStageArticles() {
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
$stage_info = $this->journal_stage_obj->where('journal_stage_id',$data['stage_id'])->find();
|
$stage_info = $this->journal_stage_obj->where('journal_stage_id', $data['stage_id'])->find();
|
||||||
$list = $this->article_obj->field('j_article.*,j_journal_stage.*')->join('j_journal_stage','j_article.journal_stage_id = j_journal_stage.journal_stage_id','LEFT')->where('j_article.journal_stage_id',$data['stage_id'])->where('j_article.state',0)->select();
|
$list = $this->article_obj->field('j_article.*,j_journal_stage.*')->join('j_journal_stage', 'j_article.journal_stage_id = j_journal_stage.journal_stage_id', 'LEFT')->where('j_article.journal_stage_id', $data['stage_id'])->where('j_article.state', 0)->select();
|
||||||
// $topic_info = $this->journal_topic_obj->where('journal_topic_id',$data['topic_id'])->find();
|
|
||||||
// $list = $this->article_to_topic_obj->field('j_article.*,j_journal_stage.*')
|
|
||||||
// ->join(array(['j_article','j_article_to_topic.article_id = j_article.article_id','LEFT'],['j_journal_stage','j_article.journal_stage_id = j_journal_stage.journal_stage_id','LEFT']))
|
|
||||||
// ->where('j_article_to_topic.topic_id',$data['topic_id'])
|
|
||||||
// ->where('j_article_to_topic.state',0)
|
|
||||||
// ->select();
|
|
||||||
//获取作者
|
//获取作者
|
||||||
foreach($list as $k=>$v){
|
foreach ($list as $k => $v) {
|
||||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||||
}
|
}
|
||||||
|
//标题斜体
|
||||||
|
foreach ($list as $k => $v) {
|
||||||
|
$caches = $this->article_ltai_obj->where('article_id', $v['article_id'])->where('state', 0)->column('content');
|
||||||
|
$cache_title = $v['title'];
|
||||||
|
foreach ($caches as $val) {
|
||||||
|
$cache_title = str_replace($val, '<i>' . $val . '</i>', $cache_title);
|
||||||
|
}
|
||||||
|
$list[$k]['title'] = $cache_title;
|
||||||
|
}
|
||||||
|
|
||||||
$re['stageInfo'] = $stage_info;
|
$re['stageInfo'] = $stage_info;
|
||||||
$re['articleList'] = $list;
|
$re['articleList'] = $list;
|
||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 获取top文章列表
|
* @title 获取top文章列表
|
||||||
* @description 获取top文章列表
|
* @description 获取top文章列表
|
||||||
@@ -194,34 +214,43 @@ class Article extends Controller{
|
|||||||
* @return articleList:文章信息#
|
* @return articleList:文章信息#
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function getTopArt(){
|
public function getTopArt() {
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
$list = [];
|
$list = [];
|
||||||
if($data['type']=='cited'){
|
if ($data['type'] == 'cited') {
|
||||||
$list = $this->article_obj->field('j_article.*,j_journal_stage.*')
|
$list = $this->article_obj->field('j_article.*,j_journal_stage.*')
|
||||||
->join('j_journal_stage','j_article.journal_stage_id = j_journal_stage.journal_stage_id','LEFT')
|
->join('j_journal_stage', 'j_article.journal_stage_id = j_journal_stage.journal_stage_id', 'LEFT')
|
||||||
->where('j_article.journal_id',$data['journal_id'])
|
->where('j_article.journal_id', $data['journal_id'])
|
||||||
->where('j_article.state',0)
|
->where('j_article.state', 0)
|
||||||
->order('j_article.cited desc')
|
->order('j_article.cited desc')
|
||||||
->select();
|
->select();
|
||||||
}else if($data['type']=='read'){
|
} else if ($data['type'] == 'read') {
|
||||||
$list = $this->article_obj->field('j_article.*,j_journal_stage.*')
|
$list = $this->article_obj->field('j_article.*,j_journal_stage.*')
|
||||||
->join('j_journal_stage','j_article.journal_stage_id = j_journal_stage.journal_stage_id','LEFT')
|
->join('j_journal_stage', 'j_article.journal_stage_id = j_journal_stage.journal_stage_id', 'LEFT')
|
||||||
->where('j_article.journal_id',$data['journal_id'])
|
->where('j_article.journal_id', $data['journal_id'])
|
||||||
->where('j_article.state',0)
|
->where('j_article.state', 0)
|
||||||
->order('j_article.abs_num desc')
|
->order('j_article.abs_num desc')
|
||||||
->select();
|
->select();
|
||||||
}else{
|
} else {
|
||||||
$list = $this->article_obj->field('j_article.*,j_journal_stage.*')
|
$list = $this->article_obj->field('j_article.*,j_journal_stage.*')
|
||||||
->join('j_journal_stage','j_article.journal_stage_id = j_journal_stage.journal_stage_id','LEFT')
|
->join('j_journal_stage', 'j_article.journal_stage_id = j_journal_stage.journal_stage_id', 'LEFT')
|
||||||
->where('j_article.journal_id',$data['journal_id'])
|
->where('j_article.journal_id', $data['journal_id'])
|
||||||
->where('j_article.state',0)
|
->where('j_article.state', 0)
|
||||||
->orderRaw('j_article.html_num+j_article.pdf_num desc')
|
->orderRaw('j_article.html_num+j_article.pdf_num desc')
|
||||||
->select();
|
->select();
|
||||||
}
|
}
|
||||||
|
//标题斜体
|
||||||
|
foreach ($list as $k => $v) {
|
||||||
|
$caches = $this->article_ltai_obj->where('article_id', $v['article_id'])->where('state', 0)->column('content');
|
||||||
|
$cache_title = $v['title'];
|
||||||
|
foreach ($caches as $val) {
|
||||||
|
$cache_title = str_replace($val, '<i>' . $val . '</i>', $cache_title);
|
||||||
|
}
|
||||||
|
$list[$k]['title'] = $cache_title;
|
||||||
|
}
|
||||||
|
|
||||||
$re['articleList'] = $list;
|
$re['articleList'] = $list;
|
||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,12 +10,14 @@ use think\Db;
|
|||||||
* @description 期刊web相关操作
|
* @description 期刊web相关操作
|
||||||
* @group 期刊web相关
|
* @group 期刊web相关
|
||||||
*/
|
*/
|
||||||
class Journal extends Controller {
|
class Journal extends Controller {
|
||||||
|
|
||||||
//put your code here
|
//put your code here
|
||||||
protected $admin_obj = '';
|
protected $admin_obj = '';
|
||||||
protected $journal_obj = '';
|
protected $journal_obj = '';
|
||||||
protected $article_obj = '';
|
protected $article_obj = '';
|
||||||
protected $article_author_obj = '';
|
protected $article_author_obj = '';
|
||||||
|
protected $article_ltai_obj = '';
|
||||||
protected $journal_topic_obj = '';
|
protected $journal_topic_obj = '';
|
||||||
protected $journal_stage_obj = '';
|
protected $journal_stage_obj = '';
|
||||||
protected $journal_notices_obj = '';
|
protected $journal_notices_obj = '';
|
||||||
@@ -31,6 +33,7 @@ class Journal extends Controller {
|
|||||||
$this->journal_obj = Db::name('journal');
|
$this->journal_obj = Db::name('journal');
|
||||||
$this->article_obj = Db::name('article');
|
$this->article_obj = Db::name('article');
|
||||||
$this->article_author_obj = Db::name('article_author');
|
$this->article_author_obj = Db::name('article_author');
|
||||||
|
$this->article_ltai_obj = Db::name('article_ltai');
|
||||||
$this->journal_topic_obj = Db::name('journal_topic');
|
$this->journal_topic_obj = Db::name('journal_topic');
|
||||||
$this->journal_stage_obj = Db::name('journal_stage');
|
$this->journal_stage_obj = Db::name('journal_stage');
|
||||||
$this->journal_notices_obj = Db::name('journal_notices');
|
$this->journal_notices_obj = Db::name('journal_notices');
|
||||||
@@ -40,7 +43,7 @@ class Journal extends Controller {
|
|||||||
$this->journal_paper_obj = Db::name('journal_paper');
|
$this->journal_paper_obj = Db::name('journal_paper');
|
||||||
$this->journal_paper_art_obj = Db::name('journal_paper_art');
|
$this->journal_paper_art_obj = Db::name('journal_paper_art');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 获取期刊列表
|
* @title 获取期刊列表
|
||||||
* @description 获取期刊列表
|
* @description 获取期刊列表
|
||||||
@@ -52,17 +55,17 @@ class Journal extends Controller {
|
|||||||
* @return journalList:期刊列表@
|
* @return journalList:期刊列表@
|
||||||
* @journalList title:标题 issn:issn editorinchief:editorinchief acceptance:acceptance finaldecision:finaldecision apc:apc
|
* @journalList title:标题 issn:issn editorinchief:editorinchief acceptance:acceptance finaldecision:finaldecision apc:apc
|
||||||
*/
|
*/
|
||||||
public function getJournalList(){
|
public function getJournalList() {
|
||||||
$where['j_journal.state'] = 0;
|
$where['j_journal.state'] = 0;
|
||||||
$res = $this->journal_obj
|
$res = $this->journal_obj
|
||||||
->field('j_journal.*,j_admin.realname realname')
|
->field('j_journal.*,j_admin.realname realname')
|
||||||
->join('j_admin','j_admin.admin_id = j_journal.editor_id','LEFT')
|
->join('j_admin', 'j_admin.admin_id = j_journal.editor_id', 'LEFT')
|
||||||
->where($where)
|
->where($where)
|
||||||
->order(['j_journal.sort desc','j_journal.journal_id'])
|
->order(['j_journal.sort desc', 'j_journal.journal_id'])
|
||||||
->select();
|
->select();
|
||||||
return json(['code'=>0,'msg'=>'success','data'=>['journalList'=>$res]]);
|
return json(['code' => 0, 'msg' => 'success', 'data' => ['journalList' => $res]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 获取期刊信息
|
* @title 获取期刊信息
|
||||||
* @description 获取期刊信息
|
* @description 获取期刊信息
|
||||||
@@ -76,14 +79,14 @@ class Journal extends Controller {
|
|||||||
* @return journalAbs:期刊外链信息array#
|
* @return journalAbs:期刊外链信息array#
|
||||||
* @return journalstage:期刊分期信息array#
|
* @return journalstage:期刊分期信息array#
|
||||||
*/
|
*/
|
||||||
public function getJournal(){
|
public function getJournal() {
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
$journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
|
$journal_info = $this->journal_obj->where('journal_id', $data['journal_id'])->find();
|
||||||
$absList = $this->journal_abs_obj->where('journal_id',$data['journal_id'])->where('state',0)->order('journal_abstracting_id')->select();
|
$absList = $this->journal_abs_obj->where('journal_id', $data['journal_id'])->where('state', 0)->order('journal_abstracting_id')->select();
|
||||||
$stageList = $this->journal_stage_obj->where('journal_id',$data['journal_id'])->where('is_publish',1)->where('state',0)->order('journal_stage_id desc')->select();
|
$stageList = $this->journal_stage_obj->where('journal_id', $data['journal_id'])->where('is_publish', 1)->where('state', 0)->order('journal_stage_id desc')->select();
|
||||||
return json(['code'=>0,'msg'=>'success','data'=>['journal'=>$journal_info,'journalAbs'=>$absList,'journalStage'=>$stageList]]);
|
return json(['code' => 0, 'msg' => 'success', 'data' => ['journal' => $journal_info, 'journalAbs' => $absList, 'journalStage' => $stageList]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 获取期刊话题
|
* @title 获取期刊话题
|
||||||
* @description 获取期刊话题
|
* @description 获取期刊话题
|
||||||
@@ -95,36 +98,37 @@ class Journal extends Controller {
|
|||||||
*
|
*
|
||||||
* @return topicList:期刊话题列表array#
|
* @return topicList:期刊话题列表array#
|
||||||
*/
|
*/
|
||||||
public function getJournalTopic(){
|
public function getJournalTopic() {
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
$res = $this->journal_topic_obj
|
$res = $this->journal_topic_obj
|
||||||
->where('journal_id',$data['journal_id'])
|
->where('journal_id', $data['journal_id'])
|
||||||
->where('state',0)
|
->where('state', 0)
|
||||||
->select();
|
->select();
|
||||||
//处理数组
|
//处理数组
|
||||||
$frag = [];
|
$frag = [];
|
||||||
foreach ($res as $v){
|
foreach ($res as $v) {
|
||||||
if($v['parent_id'] == 0){
|
if ($v['parent_id'] == 0) {
|
||||||
$frag[] = $v;
|
$frag[] = $v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ($frag as $kk => $vv){
|
foreach ($frag as $kk => $vv) {
|
||||||
$frag[$kk] = $this->getChieldarr($vv,$res);
|
$frag[$kk] = $this->getChieldarr($vv, $res);
|
||||||
}
|
}
|
||||||
return json(['code'=>0,'msg'=>'success','data'=>['topicList'=>$frag]]);
|
return json(['code' => 0, 'msg' => 'success', 'data' => ['topicList' => $frag]]);
|
||||||
}
|
}
|
||||||
private function getChieldarr($vv,$res){
|
|
||||||
if($vv['is_final']==1){
|
private function getChieldarr($vv, $res) {
|
||||||
|
if ($vv['is_final'] == 1) {
|
||||||
return $vv;
|
return $vv;
|
||||||
}
|
}
|
||||||
foreach ($res as $v){
|
foreach ($res as $v) {
|
||||||
if($v['parent_id'] == $vv['journal_topic_id']){
|
if ($v['parent_id'] == $vv['journal_topic_id']) {
|
||||||
$vv['children'][] = $this->getChieldarr($v, $res);
|
$vv['children'][] = $this->getChieldarr($v, $res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $vv;
|
return $vv;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 获取期刊推广文章
|
* @title 获取期刊推广文章
|
||||||
* @description 获取期刊推广文章
|
* @description 获取期刊推广文章
|
||||||
@@ -137,38 +141,47 @@ class Journal extends Controller {
|
|||||||
* @return articleList:期刊话题列表array#
|
* @return articleList:期刊话题列表array#
|
||||||
* @return stage:当前分期信息array#
|
* @return stage:当前分期信息array#
|
||||||
*/
|
*/
|
||||||
public function getJournalArticles(){
|
public function getJournalArticles() {
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
$journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
|
$journal_info = $this->journal_obj->where('journal_id', $data['journal_id'])->find();
|
||||||
$list = $this->article_obj->where('journal_stage_id',$journal_info['publish_stage_id'])
|
$list = $this->article_obj->where('journal_stage_id', $journal_info['publish_stage_id'])
|
||||||
->where('state',0)
|
->where('state', 0)
|
||||||
->order('sort asc')
|
->order('sort asc')
|
||||||
->select();
|
->select();
|
||||||
$stage_info = $this->journal_stage_obj->where('journal_stage_id',$journal_info['publish_stage_id'])->find();
|
$stage_info = $this->journal_stage_obj->where('journal_stage_id', $journal_info['publish_stage_id'])->find();
|
||||||
//获取作者
|
//获取作者
|
||||||
foreach($list as $k=>$v){
|
foreach ($list as $k => $v) {
|
||||||
//组合cite信息
|
//组合cite信息
|
||||||
$no = $stage_info['stage_no']==0?':':'('.$stage_info['stage_no'].'):';
|
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||||
$cite =$v['abbr'].'. '.$v['title'].'. <i>'.$journal_info['jabbr'].'</i>. '.$stage_info['stage_year'].';'.$stage_info['stage_vol'].$no.$v['npp'].'. doi:'.$v['doi'];
|
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||||
// $v['abbr'].' <i>'.$v['title'].'</i> '.$journal_info['jabbr'].' '.$stage_info['stage_year'].';'.$stage_info['stage_vol'].$no.$v['npp'].'. doi:'.$v['doi'];
|
// $v['abbr'].' <i>'.$v['title'].'</i> '.$journal_info['jabbr'].' '.$stage_info['stage_year'].';'.$stage_info['stage_vol'].$no.$v['npp'].'. doi:'.$v['doi'];
|
||||||
$list[$k]['cite'] = $cite;
|
$list[$k]['cite'] = $cite;
|
||||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||||
}
|
}
|
||||||
return json(['code'=>0,'msg'=>'success','data'=>['stage'=>$stage_info,'articleList'=>$list]]);
|
//标题斜体
|
||||||
|
foreach ($list as $k => $v) {
|
||||||
|
$caches = $this->article_ltai_obj->where('article_id', $v['article_id'])->where('state', 0)->column('content');
|
||||||
|
$cache_title = $v['title'];
|
||||||
|
foreach ($caches as $val) {
|
||||||
|
$cache_title = str_replace($val, '<i>' . $val . '</i>', $cache_title);
|
||||||
|
}
|
||||||
|
$list[$k]['title'] = $cache_title;
|
||||||
|
}
|
||||||
|
|
||||||
|
return json(['code' => 0, 'msg' => 'success', 'data' => ['stage' => $stage_info, 'articleList' => $list]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getAuthor($article){
|
private function getAuthor($article) {
|
||||||
$where['article_id'] = $article['article_id'];
|
$where['article_id'] = $article['article_id'];
|
||||||
$where['state'] = 0;
|
$where['state'] = 0;
|
||||||
$list = $this->article_author_obj->where($where)->select();
|
$list = $this->article_author_obj->where($where)->select();
|
||||||
$frag = '';
|
$frag = '';
|
||||||
foreach ($list as $k=>$v){
|
foreach ($list as $k => $v) {
|
||||||
$frag = $frag==''?''.$v['author_name']:$frag.', '.$v['author_name'];
|
$frag = $frag == '' ? '' . $v['author_name'] : $frag . ', ' . $v['author_name'];
|
||||||
}
|
}
|
||||||
return $frag;
|
return $frag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 获取onlinefirst文章
|
* @title 获取onlinefirst文章
|
||||||
* @description 获取onlinefirst文章
|
* @description 获取onlinefirst文章
|
||||||
@@ -180,25 +193,34 @@ class Journal extends Controller {
|
|||||||
*
|
*
|
||||||
* @return articlelist:文章列表array#
|
* @return articlelist:文章列表array#
|
||||||
*/
|
*/
|
||||||
public function getOnlineArticle(){
|
public function getOnlineArticle() {
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
$stages = $this->journal_stage_obj->where('journal_id',$data['journal_id'])->where('is_publish',0)->where('state',0)->column('journal_stage_id');
|
$stages = $this->journal_stage_obj->where('journal_id', $data['journal_id'])->where('is_publish', 0)->where('state', 0)->column('journal_stage_id');
|
||||||
$list = $this->article_obj
|
$list = $this->article_obj
|
||||||
->field('j_article.*,j_journal_stage.*')
|
->field('j_article.*,j_journal_stage.*')
|
||||||
->join('j_journal_stage','j_article.journal_stage_id = j_journal_stage.journal_stage_id','LEFT')
|
->join('j_journal_stage', 'j_article.journal_stage_id = j_journal_stage.journal_stage_id', 'LEFT')
|
||||||
->where('j_article.journal_stage_id','in',$stages)
|
->where('j_article.journal_stage_id', 'in', $stages)
|
||||||
->where('j_article.state',0)
|
->where('j_article.state', 0)
|
||||||
->select();
|
->select();
|
||||||
|
|
||||||
|
//标题斜体
|
||||||
|
foreach ($list as $k => $v) {
|
||||||
|
$caches = $this->article_ltai_obj->where('article_id', $v['article_id'])->where('state', 0)->column('content');
|
||||||
|
$cache_title = $v['title'];
|
||||||
|
foreach ($caches as $val) {
|
||||||
|
$cache_title = str_replace($val, '<i>' . $val . '</i>', $cache_title);
|
||||||
|
}
|
||||||
|
$list[$k]['title'] = $cache_title;
|
||||||
|
}
|
||||||
|
|
||||||
//获取作者
|
//获取作者
|
||||||
foreach($list as $k=>$v){
|
foreach ($list as $k => $v) {
|
||||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||||
}
|
}
|
||||||
|
|
||||||
return json(['code'=>0,'msg'=>'success','data'=>['articlelist'=>$list]]);
|
return json(['code' => 0, 'msg' => 'success', 'data' => ['articlelist' => $list]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 获取news文章
|
* @title 获取news文章
|
||||||
* @description 获取news文章
|
* @description 获取news文章
|
||||||
@@ -210,26 +232,35 @@ class Journal extends Controller {
|
|||||||
*
|
*
|
||||||
* @return articlelist:文章列表array#
|
* @return articlelist:文章列表array#
|
||||||
*/
|
*/
|
||||||
public function getNewsArticle(){
|
public function getNewsArticle() {
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
$stages = $this->journal_stage_obj->where('journal_id',$data['journal_id'])->where('is_publish',1)->where('state',0)->column('journal_stage_id');
|
$stages = $this->journal_stage_obj->where('journal_id', $data['journal_id'])->where('is_publish', 1)->where('state', 0)->column('journal_stage_id');
|
||||||
$list = $this->article_obj
|
$list = $this->article_obj
|
||||||
->field('j_article.*,j_journal_stage.*')
|
->field('j_article.*,j_journal_stage.*')
|
||||||
->join('j_journal_stage','j_article.journal_stage_id = j_journal_stage.journal_stage_id','LEFT')
|
->join('j_journal_stage', 'j_article.journal_stage_id = j_journal_stage.journal_stage_id', 'LEFT')
|
||||||
->where('j_article.journal_stage_id','in',$stages)
|
->where('j_article.journal_stage_id', 'in', $stages)
|
||||||
->where('j_article.state',0)
|
->where('j_article.state', 0)
|
||||||
->where('j_article.type',['like','News'],['like','Comment'],'or')
|
->where('j_article.type', ['like', 'News'], ['like', 'Comment'], 'or')
|
||||||
->order('j_article.article_id')
|
->order('j_article.article_id')
|
||||||
->select();
|
->select();
|
||||||
|
|
||||||
//获取作者
|
//获取作者
|
||||||
foreach($list as $k=>$v){
|
foreach ($list as $k => $v) {
|
||||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||||
}
|
}
|
||||||
|
//标题斜体
|
||||||
return json(['code'=>0,'msg'=>'success','data'=>['articlelist'=>$list]]);
|
foreach ($list as $k => $v) {
|
||||||
|
$caches = $this->article_ltai_obj->where('article_id', $v['article_id'])->where('state', 0)->column('content');
|
||||||
|
$cache_title = $v['title'];
|
||||||
|
foreach ($caches as $val) {
|
||||||
|
$cache_title = str_replace($val, '<i>' . $val . '</i>', $cache_title);
|
||||||
|
}
|
||||||
|
$list[$k]['title'] = $cache_title;
|
||||||
|
}
|
||||||
|
|
||||||
|
return json(['code' => 0, 'msg' => 'success', 'data' => ['articlelist' => $list]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 获取top前4条article
|
* @title 获取top前4条article
|
||||||
* @description 获取top前4条article
|
* @description 获取top前4条article
|
||||||
@@ -241,19 +272,27 @@ class Journal extends Controller {
|
|||||||
*
|
*
|
||||||
* @return articles:文章列表array#
|
* @return articles:文章列表array#
|
||||||
*/
|
*/
|
||||||
public function getTopArticle(){
|
public function getTopArticle() {
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
$list = $this->article_obj->field('j_article.*,j_journal_stage.*')->join('j_journal_stage','j_article.journal_stage_id = j_journal_stage.journal_stage_id','LEFT')->where('j_article.journal_id',$data['journal_id'])->where('j_article.state',0)->orderRaw('j_article.cited+j_article.abs_num+j_article.pdf_num desc')->limit(4)->select();
|
$list = $this->article_obj->field('j_article.*,j_journal_stage.*')->join('j_journal_stage', 'j_article.journal_stage_id = j_journal_stage.journal_stage_id', 'LEFT')->where('j_article.journal_id', $data['journal_id'])->where('j_article.state', 0)->orderRaw('j_article.cited+j_article.abs_num+j_article.pdf_num desc')->select();
|
||||||
|
|
||||||
//获取作者
|
//获取作者
|
||||||
foreach($list as $k=>$v){
|
foreach ($list as $k => $v) {
|
||||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//标题斜体
|
||||||
return jsonSuccess(['articles'=>$list]);
|
foreach ($list as $k => $v) {
|
||||||
|
$caches = $this->article_ltai_obj->where('article_id', $v['article_id'])->where('state', 0)->column('content');
|
||||||
|
$cache_title = $v['title'];
|
||||||
|
foreach ($caches as $val) {
|
||||||
|
$cache_title = str_replace($val, '<i>' . $val . '</i>', $cache_title);
|
||||||
|
}
|
||||||
|
$list[$k]['title'] = $cache_title;
|
||||||
|
}
|
||||||
|
return jsonSuccess(['articles' => $list]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 获取消息列表
|
* @title 获取消息列表
|
||||||
* @description 获取消息列表
|
* @description 获取消息列表
|
||||||
@@ -265,12 +304,12 @@ class Journal extends Controller {
|
|||||||
*
|
*
|
||||||
* @return notices:消息列表array#
|
* @return notices:消息列表array#
|
||||||
*/
|
*/
|
||||||
public function getNotices(){
|
public function getNotices() {
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
$list = $this->journal_notices_obj->where('journal_id',$data['journal_id'])->where('state',0)->order('ctime desc')->select();
|
$list = $this->journal_notices_obj->where('journal_id', $data['journal_id'])->where('state', 0)->order('ctime desc')->select();
|
||||||
return jsonSuccess(['notices'=>$list]);
|
return jsonSuccess(['notices' => $list]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 获取消息详情
|
* @title 获取消息详情
|
||||||
* @description 获取消息详情
|
* @description 获取消息详情
|
||||||
@@ -282,14 +321,14 @@ class Journal extends Controller {
|
|||||||
*
|
*
|
||||||
* @return notices:消息内容#
|
* @return notices:消息内容#
|
||||||
*/
|
*/
|
||||||
public function getNoticesDetail(){
|
public function getNoticesDetail() {
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
$notices_info = $this->journal_notices_obj->where('journal_notices_id',$data['journal_notices_id'])->find();
|
$notices_info = $this->journal_notices_obj->where('journal_notices_id', $data['journal_notices_id'])->find();
|
||||||
|
|
||||||
$re['notices'] = $notices_info;
|
$re['notices'] = $notices_info;
|
||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 获取highl话题文章
|
* @title 获取highl话题文章
|
||||||
* @description 获取highl话题文章
|
* @description 获取highl话题文章
|
||||||
@@ -302,28 +341,36 @@ class Journal extends Controller {
|
|||||||
* @return topic_info:话题详情
|
* @return topic_info:话题详情
|
||||||
* @return articlelist:文章列表array#
|
* @return articlelist:文章列表array#
|
||||||
*/
|
*/
|
||||||
public function getHighTopicArticle(){
|
public function getHighTopicArticle() {
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
$topic_info = $this->journal_topic_obj->where('journal_id',$data['journal_id'])->where('position','highlights')->where('state',0)->find();
|
$topic_info = $this->journal_topic_obj->where('journal_id', $data['journal_id'])->where('position', 'highlights')->where('state', 0)->find();
|
||||||
if($topic_info){
|
if ($topic_info) {
|
||||||
$list = $this->article_to_topic_obj->field('j_article.*,j_journal_stage.*')
|
$list = $this->article_to_topic_obj->field('j_article.*,j_journal_stage.*')
|
||||||
->join(array(['j_article','j_article.article_id = j_article_to_topic.article_id','LEFT'],['j_journal_stage','j_article.journal_stage_id = j_journal_stage.journal_stage_id','LEFT']))
|
->join(array(['j_article', 'j_article.article_id = j_article_to_topic.article_id', 'LEFT'], ['j_journal_stage', 'j_article.journal_stage_id = j_journal_stage.journal_stage_id', 'LEFT']))
|
||||||
->where('j_article_to_topic.topic_id',$topic_info['journal_topic_id'])
|
->where('j_article_to_topic.topic_id', $topic_info['journal_topic_id'])
|
||||||
->where('j_article_to_topic.state',0)
|
->where('j_article_to_topic.state', 0)
|
||||||
->select();
|
->select();
|
||||||
|
|
||||||
//获取作者
|
//获取作者
|
||||||
foreach($list as $k=>$v){
|
foreach ($list as $k => $v) {
|
||||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||||
}
|
}
|
||||||
|
//标题斜体
|
||||||
return jsonSuccess(['topic_info'=>$topic_info,'articlelist'=>$list]);
|
foreach ($list as $k => $v) {
|
||||||
}else{
|
$caches = $this->article_ltai_obj->where('article_id', $v['article_id'])->where('state', 0)->column('content');
|
||||||
|
$cache_title = $v['title'];
|
||||||
|
foreach ($caches as $val) {
|
||||||
|
$cache_title = str_replace($val, '<i>' . $val . '</i>', $cache_title);
|
||||||
|
}
|
||||||
|
$list[$k]['title'] = $cache_title;
|
||||||
|
}
|
||||||
|
|
||||||
|
return jsonSuccess(['topic_info' => $topic_info, 'articlelist' => $list]);
|
||||||
|
} else {
|
||||||
return jsonError('no highlights');
|
return jsonError('no highlights');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 获取话题列表
|
* @title 获取话题列表
|
||||||
* @description 获取话题列表
|
* @description 获取话题列表
|
||||||
@@ -336,16 +383,16 @@ class Journal extends Controller {
|
|||||||
* @return oldJournal:父期刊信息 Description
|
* @return oldJournal:父期刊信息 Description
|
||||||
* @return journalList:话题列表array#
|
* @return journalList:话题列表array#
|
||||||
*/
|
*/
|
||||||
public function getTopicList(){
|
public function getTopicList() {
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
$journal_info = $this->journal_topic_obj->where('journal_topic_id',$data['journal_topic_id'])->find();
|
$journal_info = $this->journal_topic_obj->where('journal_topic_id', $data['journal_topic_id'])->find();
|
||||||
$list = $this->journal_topic_obj->where('parent_id',$data['journal_topic_id'])->where('state',0)->select();
|
$list = $this->journal_topic_obj->where('parent_id', $data['journal_topic_id'])->where('state', 0)->select();
|
||||||
|
|
||||||
$re['oldJournal'] = $journal_info;
|
$re['oldJournal'] = $journal_info;
|
||||||
$re['journalList'] = $list;
|
$re['journalList'] = $list;
|
||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 获取期刊cfp
|
* @title 获取期刊cfp
|
||||||
* @description 获取期刊cfp
|
* @description 获取期刊cfp
|
||||||
@@ -357,14 +404,14 @@ class Journal extends Controller {
|
|||||||
*
|
*
|
||||||
* @return cfps:期刊cfps#
|
* @return cfps:期刊cfps#
|
||||||
*/
|
*/
|
||||||
public function getJournalCfp(){
|
public function getJournalCfp() {
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
$list = $this->journal_cfp_obj->where('journal_id',$data['journal_id'])->where('state',0)->select();
|
$list = $this->journal_cfp_obj->where('journal_id', $data['journal_id'])->where('state', 0)->select();
|
||||||
|
|
||||||
$re['cfps'] = $list;
|
$re['cfps'] = $list;
|
||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 获取期刊cfp详情
|
* @title 获取期刊cfp详情
|
||||||
* @description 获取期刊cfp详情
|
* @description 获取期刊cfp详情
|
||||||
@@ -376,14 +423,14 @@ class Journal extends Controller {
|
|||||||
*
|
*
|
||||||
* @return cfp:期刊cfp信息#
|
* @return cfp:期刊cfp信息#
|
||||||
*/
|
*/
|
||||||
public function getCfpDetail(){
|
public function getCfpDetail() {
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
$cfp_info = $this->journal_cfp_obj->where('journal_cfp_id',$data['journal_cfp_id'])->find();
|
$cfp_info = $this->journal_cfp_obj->where('journal_cfp_id', $data['journal_cfp_id'])->find();
|
||||||
|
|
||||||
$re['cfp'] = $cfp_info;
|
$re['cfp'] = $cfp_info;
|
||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 获取期刊footer
|
* @title 获取期刊footer
|
||||||
* @description 获取期刊footer
|
* @description 获取期刊footer
|
||||||
@@ -395,18 +442,18 @@ class Journal extends Controller {
|
|||||||
*
|
*
|
||||||
* @return footers:footers#
|
* @return footers:footers#
|
||||||
*/
|
*/
|
||||||
public function getFooter(){
|
public function getFooter() {
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
$papers = $this->journal_paper_obj->where('journal_id',$data['journal_id'])->where('state',0)->select();
|
$papers = $this->journal_paper_obj->where('journal_id', $data['journal_id'])->where('state', 0)->select();
|
||||||
foreach ($papers as $k => $v){
|
foreach ($papers as $k => $v) {
|
||||||
$cache_list = $this->journal_paper_art_obj->where('journal_paper_id',$v['journal_paper_id'])->where('state',0)->select();
|
$cache_list = $this->journal_paper_art_obj->where('journal_paper_id', $v['journal_paper_id'])->where('state', 0)->select();
|
||||||
$papers[$k]['articles'] = $cache_list;
|
$papers[$k]['articles'] = $cache_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
$re['footers'] = $papers;
|
$re['footers'] = $papers;
|
||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 获取期刊footer文章
|
* @title 获取期刊footer文章
|
||||||
* @description 获取期刊footer文章
|
* @description 获取期刊footer文章
|
||||||
@@ -418,12 +465,12 @@ class Journal extends Controller {
|
|||||||
*
|
*
|
||||||
* @return article:文章内容#
|
* @return article:文章内容#
|
||||||
*/
|
*/
|
||||||
public function getFooterArt(){
|
public function getFooterArt() {
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
$article = $this->journal_paper_art_obj->where('journal_paper_art_id',$data['journal_paper_art_id'])->find();
|
$article = $this->journal_paper_art_obj->where('journal_paper_art_id', $data['journal_paper_art_id'])->find();
|
||||||
|
|
||||||
$re['article'] = $article;
|
$re['article'] = $article;
|
||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -215,4 +215,5 @@ class Main extends Controller{
|
|||||||
}
|
}
|
||||||
return $frag;
|
return $frag;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ class Article extends Controller {
|
|||||||
protected $article_obj = '';
|
protected $article_obj = '';
|
||||||
protected $article_author_obj = '';
|
protected $article_author_obj = '';
|
||||||
protected $article_organ_obj = '';
|
protected $article_organ_obj = '';
|
||||||
|
protected $article_ltai_obj = '';
|
||||||
protected $author_to_organ_obj = '';
|
protected $author_to_organ_obj = '';
|
||||||
protected $article_to_topic_obj = '';
|
protected $article_to_topic_obj = '';
|
||||||
protected $journal_topic_obj = '';
|
protected $journal_topic_obj = '';
|
||||||
@@ -29,6 +30,7 @@ class Article extends Controller {
|
|||||||
$this->article_obj = Db::name('article');
|
$this->article_obj = Db::name('article');
|
||||||
$this->article_author_obj = Db::name('article_author');
|
$this->article_author_obj = Db::name('article_author');
|
||||||
$this->article_organ_obj = Db::name('article_organ');
|
$this->article_organ_obj = Db::name('article_organ');
|
||||||
|
$this->article_ltai_obj = Db::name('article_ltai');
|
||||||
$this->author_to_organ_obj = Db::name('article_author_to_organ');
|
$this->author_to_organ_obj = Db::name('article_author_to_organ');
|
||||||
$this->article_to_topic_obj = Db::name('article_to_topic');
|
$this->article_to_topic_obj = Db::name('article_to_topic');
|
||||||
$this->journal_topic_obj = Db::name('journal_topic');
|
$this->journal_topic_obj = Db::name('journal_topic');
|
||||||
@@ -343,6 +345,9 @@ class Article extends Controller {
|
|||||||
public function getArticleBase(){
|
public function getArticleBase(){
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
$article_info = $this->article_obj->where('article_id',$data['article_id'])->find();
|
$article_info = $this->article_obj->where('article_id',$data['article_id'])->find();
|
||||||
|
|
||||||
|
$ltais = $this->article_ltai_obj->where('article_id',$article_info['article_id'])->where('state',0)->column('content');
|
||||||
|
$article_info['ltai'] = implode(',', $ltais);
|
||||||
$journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find();
|
$journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find();
|
||||||
$list = scandir(ROOT_PATH.'public/articleHTML/'.$journal_info['sx']);
|
$list = scandir(ROOT_PATH.'public/articleHTML/'.$journal_info['sx']);
|
||||||
$frag = [];
|
$frag = [];
|
||||||
@@ -398,6 +403,7 @@ class Article extends Controller {
|
|||||||
* @param name:abs_num type:int require:1 desc:简介数量
|
* @param name:abs_num type:int require:1 desc:简介数量
|
||||||
* @param name:pdf_num type:int require:1 desc:pdf数量
|
* @param name:pdf_num type:int require:1 desc:pdf数量
|
||||||
* @param name:html_num type:int require:1 desc:html数量
|
* @param name:html_num type:int require:1 desc:html数量
|
||||||
|
* @param name:ltai type:string require:0 desc:标题斜体(demo1,demo2)
|
||||||
* @param name:npp type:strng require:1 desc:文章页码
|
* @param name:npp type:strng require:1 desc:文章页码
|
||||||
* @param name:type type:string require:1 desc:类型
|
* @param name:type type:string require:1 desc:类型
|
||||||
* @param name:cited type:int require:1 desc:引用数
|
* @param name:cited type:int require:1 desc:引用数
|
||||||
@@ -410,6 +416,9 @@ class Article extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function editArticleBase(){
|
public function editArticleBase(){
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
|
if(isset($data['ltai'])){
|
||||||
|
$this->editArticleLtai($data['ltai'],$data['article_id']);
|
||||||
|
}
|
||||||
$updata['icon'] = $data['icon'];
|
$updata['icon'] = $data['icon'];
|
||||||
$updata['title'] = $data['title'];
|
$updata['title'] = $data['title'];
|
||||||
$updata['journal_stage_id'] = $data['journal_stage_id'];
|
$updata['journal_stage_id'] = $data['journal_stage_id'];
|
||||||
@@ -430,13 +439,36 @@ class Article extends Controller {
|
|||||||
$updata['sort'] = $data['sort'];
|
$updata['sort'] = $data['sort'];
|
||||||
$updata['pub_date'] = $data['pub_date'];
|
$updata['pub_date'] = $data['pub_date'];
|
||||||
$res = $this->article_obj->where('article_id',$data['article_id'])->update($updata);
|
$res = $this->article_obj->where('article_id',$data['article_id'])->update($updata);
|
||||||
if($res){
|
// if($res){
|
||||||
return json(['code'=>0,'msg'=>'success']);
|
return json(['code'=>0,'msg'=>'success']);
|
||||||
}else{
|
// }else{
|
||||||
return json(['code'=>1,'msg'=>'system error']);
|
// return json(['code'=>1,'msg'=>'system error']);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
private function editArticleLtai($ltai,$article_id){
|
||||||
|
$list = explode(',', $ltai);
|
||||||
|
$has = $this->article_ltai_obj->where('article_id',$article_id)->where('state',0)->select();
|
||||||
|
foreach ($has as $val){
|
||||||
|
if(in_array($val['content'], $list)){
|
||||||
|
foreach( $list as $k=>$v) {
|
||||||
|
if($val['content'] == $v) {
|
||||||
|
unset($list[$k]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
//删除
|
||||||
|
$this->article_ltai_obj->where('article_ltai_id',$val['article_ltai_id'])->update(['state'=>1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//增加
|
||||||
|
foreach ($list as $value){
|
||||||
|
$cache['article_id'] = $article_id;
|
||||||
|
$cache['content'] = $value;
|
||||||
|
$this->article_ltai_obj->insert($cache);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 编辑文章文件信息
|
* @title 编辑文章文件信息
|
||||||
* @description 编辑文章文件信息
|
* @description 编辑文章文件信息
|
||||||
@@ -508,6 +540,14 @@ class Article extends Controller {
|
|||||||
}
|
}
|
||||||
$limit_start = ($data['pageIndex'] - 1) * $data['pageSize'];
|
$limit_start = ($data['pageIndex'] - 1) * $data['pageSize'];
|
||||||
$article_list = $this->article_obj->field('j_article.*,j_journal_stage.*,j_journal.title journal_title')->join(array(['j_journal_stage','j_article.journal_stage_id = j_journal_stage.journal_stage_id','LEFT'],['j_journal','j_journal.journal_id=j_article.journal_id','LEFT']))->where($where)->order(['j_article.sort desc','j_article.article_id'])->limit($limit_start,$data['pageSize'])->select();
|
$article_list = $this->article_obj->field('j_article.*,j_journal_stage.*,j_journal.title journal_title')->join(array(['j_journal_stage','j_article.journal_stage_id = j_journal_stage.journal_stage_id','LEFT'],['j_journal','j_journal.journal_id=j_article.journal_id','LEFT']))->where($where)->order(['j_article.sort desc','j_article.article_id'])->limit($limit_start,$data['pageSize'])->select();
|
||||||
|
foreach ($article_list as $k => $v){
|
||||||
|
$caches = $this->article_ltai_obj->where('article_id',$v['article_id'])->where('state',0)->column('content');
|
||||||
|
$cache_title = $v['title'];
|
||||||
|
foreach ($caches as $val){
|
||||||
|
$cache_title = str_replace($val, '<i>'.$val.'</i>', $cache_title);
|
||||||
|
}
|
||||||
|
$article_list[$k]['title'] = $cache_title;
|
||||||
|
}
|
||||||
$count = $this->article_obj->where($where)->count();
|
$count = $this->article_obj->where($where)->count();
|
||||||
return json(['code'=>0,'msg'=>'success','data'=>['count'=>$count,'articleList'=>$article_list]]);
|
return json(['code'=>0,'msg'=>'success','data'=>['count'=>$count,'articleList'=>$article_list]]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user