20201112
This commit is contained in:
@@ -127,6 +127,7 @@ class Article extends Controller {
|
||||
public function getTopicArticles() {
|
||||
$data = $this->request->post();
|
||||
$topic_info = $this->journal_topic_obj->where('journal_topic_id', $data['topic_id'])->find();
|
||||
$journal_info = $this->journal_obj->where('journal_id',$topic_info['journal_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'])
|
||||
@@ -134,6 +135,11 @@ class Article extends Controller {
|
||||
->select();
|
||||
//获取作者
|
||||
foreach ($list as $k => $v) {
|
||||
$stage_info = $this->journal_stage_obj->where('journal_stage_id',$v['journal_stage_id'])->find();
|
||||
//组合cite信息
|
||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $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);
|
||||
}
|
||||
//标题斜体
|
||||
@@ -189,9 +195,15 @@ class Article extends Controller {
|
||||
public function getStageArticles() {
|
||||
$data = $this->request->post();
|
||||
$stage_info = $this->journal_stage_obj->where('journal_stage_id', $data['stage_id'])->find();
|
||||
$journal_info = $this->journal_obj->where('journal_id',$stage_info['journal_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();
|
||||
//获取作者
|
||||
foreach ($list as $k => $v) {
|
||||
$stage_info = $this->journal_stage_obj->where('journal_stage_id',$v['journal_stage_id'])->find();
|
||||
//组合cite信息
|
||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $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);
|
||||
}
|
||||
//标题斜体
|
||||
@@ -219,11 +231,16 @@ class Article extends Controller {
|
||||
* @param name:article_id type:int require:1 desc:期刊id
|
||||
* @param name:type type:string require:1 desc:类型(abs/html/pdf)
|
||||
*
|
||||
* @return article:文章详情
|
||||
*
|
||||
*/
|
||||
public function addArticleNum(){
|
||||
$data = $this->request->post();
|
||||
$this->article_obj->where('article_id',$data['article_id'])->setInc($data['type'].'_num');
|
||||
return jsonSuccess([]);
|
||||
$article_info = $this->article_obj->where('article_id',$data['article_id'])->find();
|
||||
|
||||
$re['article'] = $article_info;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -189,11 +189,12 @@ class Journal extends Controller {
|
||||
public function getJournalLineArt(){
|
||||
$data = $this->request->post();
|
||||
$journalLine = $this->journal_line_obj->where('journal_line_id',$data['journal_line_id'])->find();
|
||||
$journal_info = $this->journal_obj->where('journal_id',$journalLine['journal_id'])->find();
|
||||
$list = $this->article_to_line_obj->field('j_article.*,j_journal_stage.*')
|
||||
->join([['j_article','j_article_to_line.article_id = j_article.article_id','LEFT'],['j_journal_stage','j_journal_stage.journal_stage_id = j_article.journal_stage_id','LEFT']])
|
||||
->where('j_article_to_line.journal_line_id',$data['journal_line_id'])
|
||||
->where('j_article_to_line.state',0)
|
||||
->order('j_aricle.sort desc')
|
||||
->order('j_article.sort desc')
|
||||
->select();
|
||||
//标题斜体
|
||||
foreach ($list as $k => $v) {
|
||||
@@ -204,11 +205,21 @@ class Journal extends Controller {
|
||||
}
|
||||
$list[$k]['title'] = $cache_title;
|
||||
}
|
||||
|
||||
|
||||
//获取作者
|
||||
foreach ($list as $k => $v) {
|
||||
$stage_info = $this->journal_stage_obj->where('journal_stage_id',$v['journal_stage_id'])->find();
|
||||
//组合cite信息
|
||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $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);
|
||||
}
|
||||
|
||||
// //获取作者
|
||||
// foreach ($list as $k => $v) {
|
||||
// $list[$k]['authortitle'] = $this->getAuthor($v);
|
||||
// }
|
||||
|
||||
$re['journalLine'] = $journalLine;
|
||||
$re['articles'] = $list;
|
||||
@@ -281,6 +292,7 @@ class Journal extends Controller {
|
||||
public function getOnlineArticle() {
|
||||
$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');
|
||||
$journal_info = $this->journal_obj->where('journal_id',$data['journal_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')
|
||||
@@ -301,6 +313,11 @@ class Journal extends Controller {
|
||||
|
||||
//获取作者
|
||||
foreach ($list as $k => $v) {
|
||||
$stage_info = $this->journal_stage_obj->where('journal_stage_id',$v['journal_stage_id'])->find();
|
||||
//组合cite信息
|
||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $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);
|
||||
}
|
||||
|
||||
@@ -321,6 +338,7 @@ class Journal extends Controller {
|
||||
public function getNewsArticle() {
|
||||
$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');
|
||||
$journal_info = $this->journal_obj->where('journal_id',$data['journal_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')
|
||||
@@ -332,6 +350,11 @@ class Journal extends Controller {
|
||||
|
||||
//获取作者
|
||||
foreach ($list as $k => $v) {
|
||||
$stage_info = $this->journal_stage_obj->where('journal_stage_id',$v['journal_stage_id'])->find();
|
||||
//组合cite信息
|
||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $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);
|
||||
}
|
||||
//标题斜体
|
||||
@@ -360,6 +383,7 @@ class Journal extends Controller {
|
||||
*/
|
||||
public function getTopArticle() {
|
||||
$data = $this->request->post();
|
||||
$journal_info = $this->journal_obj->where('journal_id',$data['journal_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_id', $data['journal_id'])
|
||||
@@ -369,6 +393,11 @@ class Journal extends Controller {
|
||||
|
||||
//获取作者
|
||||
foreach ($list as $k => $v) {
|
||||
$stage_info = $this->journal_stage_obj->where('journal_stage_id',$v['journal_stage_id'])->find();
|
||||
//组合cite信息
|
||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $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);
|
||||
}
|
||||
|
||||
@@ -435,6 +464,7 @@ class Journal extends Controller {
|
||||
public function getHighTopicArticle() {
|
||||
$data = $this->request->post();
|
||||
$topic_info = $this->journal_topic_obj->where('journal_id', $data['journal_id'])->where('position', 'highlights')->where('state', 0)->find();
|
||||
$journal_info = $this->journal_obj->where('journal_id', $data['journal_id'])->find();
|
||||
if ($topic_info) {
|
||||
$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']))
|
||||
@@ -444,9 +474,14 @@ class Journal extends Controller {
|
||||
->select();
|
||||
|
||||
//获取作者
|
||||
foreach ($list as $k => $v) {
|
||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||
}
|
||||
foreach ($list as $k => $v) {
|
||||
$stage_info = $this->journal_stage_obj->where('journal_stage_id',$v['journal_stage_id'])->find();
|
||||
//组合cite信息
|
||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $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);
|
||||
}
|
||||
//标题斜体
|
||||
foreach ($list as $k => $v) {
|
||||
$caches = $this->article_ltai_obj->where('article_id', $v['article_id'])->where('state', 0)->column('content');
|
||||
|
||||
@@ -472,6 +472,7 @@ class Journal extends Controller {
|
||||
*
|
||||
* @param name:journal_id type:int require:1 desc:期刊id
|
||||
* @param name:topic_id type:int require:1 desc:话题id
|
||||
* @param name:title type:string require:1 desc:标题
|
||||
* @param name:pageIndex type:int require:1 desc:当前页码数
|
||||
* @param name:pageSize type:int require:1 desc:单页数据条数
|
||||
*
|
||||
@@ -482,8 +483,8 @@ class Journal extends Controller {
|
||||
//排除stage
|
||||
$ids = $this->article_to_topic_obj->where('topic_id',$data['topic_id'])->where('state',0)->column('article_id');
|
||||
$limit_start = ($data['pageIndex'] - 1) * $data['pageSize'];
|
||||
$list = $this->article_obj->where('journal_id',$data['journal_id'])->where('state',0)->where('article_id','not in',$ids)->limit($limit_start,$data['pageSize'])->select();
|
||||
$count = $this->article_obj->where('journal_id',$data['journal_id'])->where('state',0)->where('article_id','not in',$ids)->count();
|
||||
$list = $this->article_obj->where('journal_id',$data['journal_id'])->where('state',0)->where('article_id','not in',$ids)->where('title','like','%'.$data['title'].'%')->limit($limit_start,$data['pageSize'])->select();
|
||||
$count = $this->article_obj->where('journal_id',$data['journal_id'])->where('state',0)->where('article_id','not in',$ids)->where('title','like','%'.$data['title'].'%')->count();
|
||||
return json(['code'=>0,'msg'=>'success','data'=>['count'=>$count,'dataList'=>$list]]);
|
||||
}
|
||||
|
||||
@@ -1151,7 +1152,7 @@ class Journal extends Controller {
|
||||
$data = $this->request->post();
|
||||
$journal_line_info = $this->journal_line_obj->where('journal_line_id',$data['journal_line_id'])->find();
|
||||
$journal_info = $this->journal_obj->where('journal_id',$journal_line_info['journal_id'])->find();
|
||||
$list = $this->article_to_line_obj->field('j_article.*')
|
||||
$list = $this->article_to_line_obj->field('j_article_to_line.*,j_article.*')
|
||||
->join('j_article','j_article.article_id = j_article_to_line.article_id','LEFT')
|
||||
->where('j_article_to_line.journal_line_id',$data['journal_line_id'])
|
||||
->where('j_article_to_line.state',0)
|
||||
@@ -1172,6 +1173,7 @@ class Journal extends Controller {
|
||||
*
|
||||
* @param name:journal_id type:int require:1 desc:期刊id
|
||||
* @param name:journal_line_id type:int require:1 desc:时间线id
|
||||
* @param name:title type:string require:1 desc:标题
|
||||
* @param name:pageIndex type:int require:1 desc:当前页码数
|
||||
* @param name:pageSize type:int require:1 desc:单页数据条数
|
||||
*
|
||||
@@ -1183,8 +1185,8 @@ class Journal extends Controller {
|
||||
//排除line
|
||||
$ids = $this->article_to_line_obj->where('journal_line_id',$data['journal_line_id'])->where('state',0)->column('article_id');
|
||||
$limit_start = ($data['pageIndex'] - 1) * $data['pageSize'];
|
||||
$list = $this->article_obj->where('journal_id',$data['journal_id'])->where('state',0)->where('article_id','not in',$ids)->limit($limit_start,$data['pageSize'])->select();
|
||||
$count = $this->article_obj->where('journal_id',$data['journal_id'])->where('state',0)->where('article_id','not in',$ids)->count();
|
||||
$list = $this->article_obj->where('journal_id',$data['journal_id'])->where('state',0)->where('article_id','not in',$ids)->where('title','like','%'.$data['title'].'%')->limit($limit_start,$data['pageSize'])->select();
|
||||
$count = $this->article_obj->where('journal_id',$data['journal_id'])->where('state',0)->where('article_id','not in',$ids)->where('title','like','%'.$data['title'].'%')->count();
|
||||
|
||||
$re['count'] = $count;
|
||||
$re['dataList'] = $list;
|
||||
|
||||
Reference in New Issue
Block a user