20201112
This commit is contained in:
137
application/api/controller/Article.php
Normal file
137
application/api/controller/Article.php
Normal file
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Controller;
|
||||
use think\Db;
|
||||
|
||||
/**
|
||||
* @title 文章web接口
|
||||
* @description 文章web相关操作
|
||||
* @group 文章web相关
|
||||
*/
|
||||
class Article extends Controller{
|
||||
//put your code here
|
||||
protected $admin_obj = '';
|
||||
protected $journal_obj = '';
|
||||
protected $article_obj = '';
|
||||
protected $article_author_obj = '';
|
||||
protected $article_organ_obj = '';
|
||||
protected $article_author_to_organ_obj = '';
|
||||
protected $journal_topic_obj = '';
|
||||
protected $journal_stage_obj = '';
|
||||
protected $journal_notices_obj = '';
|
||||
protected $journal_abs_obj = '';
|
||||
protected $article_to_topic_obj = '';
|
||||
|
||||
public function __construct(\think\Request $request = null) {
|
||||
parent::__construct($request);
|
||||
$this->admin_obj = Db::name('admin');
|
||||
$this->journal_obj = Db::name('journal');
|
||||
$this->article_obj = Db::name('article');
|
||||
$this->article_author_obj = Db::name('article_author');
|
||||
$this->article_organ_obj = Db::name('article_organ');
|
||||
$this->article_author_to_organ_obj = Db::name('article_author_to_organ');
|
||||
$this->journal_topic_obj = Db::name('journal_topic');
|
||||
$this->journal_stage_obj = Db::name('journal_stage');
|
||||
$this->journal_notices_obj = Db::name('journal_notices');
|
||||
$this->journal_abs_obj = Db::name('journal_abstracting');
|
||||
$this->article_to_topic_obj = Db::name('article_to_topic');
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 获取文章详情
|
||||
* @description 获取文章详情
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/getArticleDetail
|
||||
* @method POST
|
||||
*
|
||||
* @param name:article_id type:int require:1 desc:文章id
|
||||
*
|
||||
* @return articleInfo:文章信息#
|
||||
* @return journalInfo:期刊信息#
|
||||
* @return stageInfo:分期信息#
|
||||
* @return author:作者信息#
|
||||
* @return cite:引用#
|
||||
*
|
||||
*/
|
||||
public function getArticleDetail(){
|
||||
$data = $this->request->post();
|
||||
$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();
|
||||
$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();
|
||||
$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();
|
||||
$author = $this->sys_author($authors,$organs,$atto);
|
||||
|
||||
//组合cite信息
|
||||
$no = $stage_info['stage_no']==0?':':'('.$stage_info['stage_no'].'):';
|
||||
$cite = $article_info['abbr'].' '.$article_info['title'].' '.$journal_info['jabbr'].' '.$stage_info['stage_year'].';'.$stage_info['stage_vol'].$no.$article_info['npp'].'. doi:'.$article_info['doi'];
|
||||
$re['articleInfo'] = $article_info;
|
||||
$re['journalInfo'] = $journal_info;
|
||||
$re['stageInfo'] = $stage_info;
|
||||
$re['author'] = $author;
|
||||
$re['cite'] = $cite;
|
||||
return jsonSuccess($re);
|
||||
|
||||
}
|
||||
private function sys_author($authors,$organs,$atto){
|
||||
$cache = [];
|
||||
foreach ($organs as $k => $v){
|
||||
$cache[$v['article_organ_id']] = $k+1;
|
||||
$organs[$k]['alias'] = $k+1;
|
||||
}
|
||||
foreach ($authors as $key => $val){
|
||||
$authors[$key]['ors'] = '';
|
||||
foreach ($atto as $vv){
|
||||
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']];
|
||||
}
|
||||
}
|
||||
}
|
||||
return ['authors'=>$authors,'organs'=>$organs];
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 获取话题文章列表
|
||||
* @description 获取话题文章列表
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/getTopicArticles
|
||||
* @method POST
|
||||
*
|
||||
* @param name:topic_id type:int require:1 desc:文章id
|
||||
*
|
||||
* @return topicInfo:话题信息#
|
||||
* @return articleList:文章信息#
|
||||
*
|
||||
*/
|
||||
public function getTopicArticles(){
|
||||
$data = $this->request->post();
|
||||
$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){
|
||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||
}
|
||||
$re['topicInfo'] = $topic_info;
|
||||
$re['articleList'] = $list;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
private function getAuthor($article){
|
||||
$where['article_id'] = $article['article_id'];
|
||||
$where['state'] = 0;
|
||||
$list = $this->article_author_obj->where($where)->select();
|
||||
$frag = '';
|
||||
foreach ($list as $k=>$v){
|
||||
$frag .= $v['author_name'].',';
|
||||
}
|
||||
return substr($frag,0, -1);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -206,6 +206,23 @@ class Journal extends Controller {
|
||||
return json(['code'=>0,'msg'=>'success','data'=>['articlelist'=>$list]]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 获取top前4条article
|
||||
* @description 获取top前4条article
|
||||
* @author wangjinlei
|
||||
* @url /api/Journal/getTopArticle
|
||||
* @method POST
|
||||
*
|
||||
* @param name:journal_id type:int require:1 desc:期刊id
|
||||
*
|
||||
* @return articles:文章列表array#
|
||||
*/
|
||||
public function getTopArticle(){
|
||||
$data = $this->request->post();
|
||||
$list = $this->article_obj->where('journal_id',$data['journal_id'])->where('state',0)->orderRaw('cited+abs_num+pdf_num desc')->limit(4)->select();
|
||||
return jsonSuccess(['articles'=>$list]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 获取消息列表
|
||||
* @description 获取消息列表
|
||||
@@ -224,26 +241,53 @@ class Journal extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 获取话题文章
|
||||
* @description 获取话题文章
|
||||
* @title 获取highl话题文章
|
||||
* @description 获取highl话题文章
|
||||
* @author wangjinlei
|
||||
* @url /api/Journal/getTopicArticle
|
||||
* @url /api/Journal/getHighTopicArticle
|
||||
* @method POST
|
||||
*
|
||||
* @param name:journal_topic_id type:int require:1 desc:期刊话题id
|
||||
* @param name:journal_id type:int require:1 desc:期刊id
|
||||
*
|
||||
* @return topic_info:话题详情
|
||||
* @return articlelist:文章列表array#
|
||||
*/
|
||||
public function getTopicArticle(){
|
||||
public function getHighTopicArticle(){
|
||||
$data = $this->request->post();
|
||||
$topic_info = $this->journal_topic_obj->where('journal_topic_id',$data['journal_topic_id'])->find();
|
||||
$list = $this->article_to_topic_obj->field('j_article.*')
|
||||
->join('j_article','j_article.article_id = j_article_to_topic.article_id','LEFT')
|
||||
->where('j_article_to_topic.topic_id',$data['journal_topic_id'])
|
||||
->where('j_article_to_topic.state',0)
|
||||
->select();
|
||||
return json(['code'=>0,'msg'=>'success','data'=>['topic_info'=>$topic_info,'articlelist'=>$list]]);
|
||||
$topic_info = $this->journal_topic_obj->where('journal_id',$data['journal_id'])->where('position','highlights')->where('state',0)->find();
|
||||
if($topic_info){
|
||||
$list = $this->article_to_topic_obj->field('j_article.*')
|
||||
->join('j_article','j_article.article_id = j_article_to_topic.article_id','LEFT')
|
||||
->where('j_article_to_topic.topic_id',$topic_info['journal_topic_id'])
|
||||
->where('j_article_to_topic.state',0)
|
||||
->select();
|
||||
return jsonSuccess(['topic_info'=>$topic_info,'articlelist'=>$list]);
|
||||
}else{
|
||||
return jsonError('no highlights');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 获取话题列表
|
||||
* @description 获取话题列表
|
||||
* @author wangjinlei
|
||||
* @url /api/Journal/getTopicList
|
||||
* @method POST
|
||||
*
|
||||
* @param name:journal_topic_id type:int require:1 desc:期刊话题id
|
||||
*
|
||||
* @return oldJournal:父期刊信息 Description
|
||||
* @return journalList:话题列表array#
|
||||
*/
|
||||
public function getTopicList(){
|
||||
$data = $this->request->post();
|
||||
$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();
|
||||
|
||||
$re['oldJournal'] = $journal_info;
|
||||
$re['journalList'] = $list;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,8 @@ return [
|
||||
'app\master\controller\Mysystem',
|
||||
'app\master\controller\Journal',
|
||||
'app\master\controller\Article',
|
||||
'app\api\controller\Journal'
|
||||
'app\api\controller\Journal',
|
||||
'app\api\controller\Article'
|
||||
],
|
||||
'filter_method' => [
|
||||
//过滤 不解析的方法名称
|
||||
|
||||
@@ -360,6 +360,7 @@ class Article extends Controller {
|
||||
* @param name:html_num type:int require:1 desc:html数量
|
||||
* @param name:npp type:strng require:1 desc:文章页码
|
||||
* @param name:type type:string require:1 desc:类型
|
||||
* @param name:cited type:int require:1 desc:引用数
|
||||
* @param name:abbr type:string require:0 desc:作者简称
|
||||
* @param name:sort type:int require:1 desc:权重
|
||||
* @param name:fund type:string require:1 desc:fund
|
||||
@@ -381,6 +382,7 @@ class Article extends Controller {
|
||||
$updata['html_num'] = $data['html_num'];
|
||||
$updata['npp'] = $data['npp'];
|
||||
$updata['type'] = $data['type'];
|
||||
$updata['cited'] = $data['cited'];
|
||||
$updata['abbr'] = $data['abbr'];
|
||||
$updata['fund'] = $data['fund'];
|
||||
$updata['sort'] = $data['sort'];
|
||||
@@ -401,7 +403,7 @@ class Article extends Controller {
|
||||
* @method POST
|
||||
*
|
||||
* @param name:article_id type:int require:1 desc:文章id
|
||||
* @param name:filetype type:string require:1 desc:文件类型(PDF/HTML/SUB/SUB2)
|
||||
* @param name:filetype type:string require:1 desc:文件类型(PDF/HTML/SUB/SUB2/endNote/bibTex)
|
||||
* @param name:fileURL type:string require:1 desc:文件地址
|
||||
*
|
||||
*/
|
||||
@@ -413,8 +415,12 @@ class Article extends Controller {
|
||||
$updata['file_html'] = $data['fileURL'];
|
||||
}elseif($data['filetype']=='SUB'){
|
||||
$updata['file_sub'] = $data['fileURL'];
|
||||
}else{
|
||||
}elseif($data['filetype']=='SUB2'){
|
||||
$updata['file_sub2'] = $data['fileURL'];
|
||||
}elseif($data['filetype']=='endNote'){
|
||||
$updata['endnote'] = $data['fileURL'];
|
||||
}elseif($data['filetype']=='bibTex'){
|
||||
$updata['bibtex'] = $data['fileURL'];
|
||||
}
|
||||
$this->article_obj->where('article_id',$data['article_id'])->update($updata);
|
||||
return json(['code'=>0,'msg'=>'success']);
|
||||
@@ -580,8 +586,8 @@ class Article extends Controller {
|
||||
* @url /master/Article/article_file
|
||||
* @method GET
|
||||
*
|
||||
* @param name:name type:string require:1 desc:文件域名称(articlePDF/articleHTML/articleSUB/articleSUB2)
|
||||
* @param name:type type:string require:1 desc:pathinfo(articlePDF/articleHTML/articleSUB/articleSUB2)
|
||||
* @param name:name type:string require:1 desc:文件域名称(articlePDF/articleHTML/articleSUB/articleSUB2/bibTex/endNote)
|
||||
* @param name:type type:string require:1 desc:pathinfo(articlePDF/articleHTML/articleSUB/articleSUB2/bibTex/endNote)
|
||||
*
|
||||
* @return upurl:图片地址
|
||||
*/
|
||||
|
||||
@@ -20,6 +20,9 @@ class Journal extends Controller {
|
||||
protected $journal_notices_obj = '';
|
||||
protected $journal_abs_obj = '';
|
||||
protected $article_to_topic_obj = '';
|
||||
protected $journal_cfp_obj = '';
|
||||
protected $journal_paper_obj = '';
|
||||
protected $journal_paper_art_obj = '';
|
||||
|
||||
public function __construct(\think\Request $request = null) {
|
||||
parent::__construct($request);
|
||||
@@ -31,6 +34,9 @@ class Journal extends Controller {
|
||||
$this->journal_notices_obj = Db::name('journal_notices');
|
||||
$this->journal_abs_obj = Db::name('journal_abstracting');
|
||||
$this->article_to_topic_obj = Db::name('article_to_topic');
|
||||
$this->journal_cfp_obj = Db::name('journal_cfp');
|
||||
$this->journal_paper_obj = Db::name('journal_paper');
|
||||
$this->journal_paper_art_obj = Db::name('journal_paper_art');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -103,25 +109,6 @@ class Journal extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 获取期刊详情
|
||||
* @description 获取期刊详情
|
||||
* @author wangjinlei
|
||||
* @url /master/Journal/getJournalDetail
|
||||
* @method POST
|
||||
*
|
||||
* @param name:journal_id require:1 desc:主键
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public function getJournalDetail(){
|
||||
// $data = $this->request->post();
|
||||
// $journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @title 删除期刊
|
||||
* @description 删除期刊
|
||||
@@ -777,12 +764,257 @@ class Journal extends Controller {
|
||||
* @param name:journal_id type:int require:1 desc:期刊id
|
||||
*
|
||||
* @return notices:消息list
|
||||
*
|
||||
* @return journal_info:期刊消息
|
||||
*/
|
||||
public function getNotices(){
|
||||
$data = $this->request->post();
|
||||
$journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
|
||||
$list = $this->journal_notices_obj->where('journal_id',$data['journal_id'])->where('state',0)->select();
|
||||
return jsonSuccess(['notices'=>$list]);
|
||||
return jsonSuccess(['journal_info'=>$journal_info,'notices'=>$list]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 增加期刊收刊文章
|
||||
* @description 增加期刊收刊文章
|
||||
* @author wangjinlei
|
||||
* @url /master/Journal/addJournalCfp
|
||||
* @method POST
|
||||
*
|
||||
* @param name:journal_id type:int require:1 desc:期刊id
|
||||
* @param name:title type:string require:1 desc:标题
|
||||
* @param name:icon type:string require:1 desc:图标
|
||||
* @param name:content type:string require:1 desc:内容
|
||||
*
|
||||
* @return notices:消息list
|
||||
* @return journal_info:期刊消息
|
||||
*/
|
||||
public function addJournalCfp(){
|
||||
$data = $this->request->post();
|
||||
$insert['journal_id'] = $data['journal_id'];
|
||||
$insert['title'] = $data['title'];
|
||||
$insert['icon'] = $data['icon'];
|
||||
$insert['content'] = $data['content'];
|
||||
$insert['ctime'] = time();
|
||||
$this->journal_cfp_obj->insert($insert);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 删除期刊收刊文章
|
||||
* @description 删除期刊收刊文章
|
||||
* @author wangjinlei
|
||||
* @url /master/Journal/delJournalCfp
|
||||
* @method POST
|
||||
*
|
||||
* @param name:journal_cfp_id type:int require:1 desc:期刊收刊id
|
||||
*
|
||||
*/
|
||||
public function delJournalCfp(){
|
||||
$data = $this->request->post();
|
||||
$this->journal_cfp_obj->where('journal_cfp_id',$data['journal_cfp_id'])->update(['state'=>1]);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 编辑期刊收刊信息
|
||||
* @description 删除期刊收刊文章
|
||||
* @author wangjinlei
|
||||
* @url /master/Journal/delJournalCfp
|
||||
* @method POST
|
||||
*
|
||||
* @param name:journal_cfp_id type:int require:1 desc:期刊收刊id
|
||||
* @param name:title type:string require:1 desc:标题
|
||||
* @param name:icon type:string require:1 desc:图标
|
||||
* @param name:content type:string require:1 desc:内容
|
||||
*/
|
||||
public function editJournalCfp(){
|
||||
$data = $this->request->post();
|
||||
$update['title'] = $data['title'];
|
||||
$update['icon'] = $data['icon'];
|
||||
$update['content'] = $data['content'];
|
||||
$this->journal_cfp_obj->where('journal_cfp_id',$data['journal_cfp_id'])->update($update);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 获取期刊收刊列表
|
||||
* @description 获取期刊收刊列表
|
||||
* @author wangjinlei
|
||||
* @url /master/Journal/getJournalCfps
|
||||
* @method POST
|
||||
*
|
||||
* @param name:journal_id type:int require:1 desc:期刊id
|
||||
*
|
||||
* @return cfps:收刊列表#
|
||||
*/
|
||||
public function getJournalCfps(){
|
||||
$data = $this->request->post();
|
||||
$list = $this->journal_cfp_obj->where('journal_id',$data['journal_id'])->where('state',0)->select();
|
||||
|
||||
$re['cfps'] = $list;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title cfp图片上传
|
||||
* @description cfp图片上传
|
||||
* @author wangjinlei
|
||||
* @url /master/Journal/up_cfp_file
|
||||
* @method POST
|
||||
*
|
||||
* @param name:name type:string require:1 default:journaltopic desc:文件域名称
|
||||
*
|
||||
* @return upurl:图片地址
|
||||
*/
|
||||
public function up_cfp_file() {
|
||||
$file = request()->file('journalCfp');
|
||||
if ($file) {
|
||||
$info = $file->move(ROOT_PATH . 'public' . DS . 'journalCfp');
|
||||
if ($info) {
|
||||
return json(['code'=>0 , 'msg'=>'success', 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
|
||||
} else {
|
||||
return json(['code' => 1, 'msg' => $file->getError()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 添加期刊paper
|
||||
* @description 添加期刊paper
|
||||
* @author wangjinlei
|
||||
* @url /master/Journal/addJournalPaper
|
||||
* @method POST
|
||||
*
|
||||
* @param name:journal_id type:int require:1 desc:期刊id
|
||||
* @param name:title type:string require:1 desc:标题
|
||||
*
|
||||
*/
|
||||
public function addJournalPaper(){
|
||||
$data = $this->request->post();
|
||||
$insert['journal_id'] = $data['journal_id'];
|
||||
$insert['title'] = $data['title'];
|
||||
$this->journal_paper_obj->insert($insert);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 删除期刊paper
|
||||
* @description 删除期刊paper
|
||||
* @author wangjinlei
|
||||
* @url /master/Journal/delJournalPaper
|
||||
* @method POST
|
||||
*
|
||||
* @param name:journal_paper_id type:int require:1 desc:期刊paperid
|
||||
*
|
||||
*/
|
||||
public function delJournalPaper(){
|
||||
$data = $this->request->post();
|
||||
$this->journal_paper_obj->where('journal_paper_id',$data['journal_paper_id'])->update(['state'=>1]);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 编辑期刊paper
|
||||
* @description 编辑期刊paper
|
||||
* @author wangjinlei
|
||||
* @url /master/Journal/editJournalPaper
|
||||
* @method POST
|
||||
*
|
||||
* @param name:journal_paper_id type:int require:1 desc:期刊paperid
|
||||
* @param name:title type:string require:1 desc:标题
|
||||
*
|
||||
*/
|
||||
public function editJournalPaper(){
|
||||
$data = $this->request->post();
|
||||
$this->journal_paper_obj->where('journal_paper_id',$data['journal_paper_id'])->update(['title'=>$data['title']]);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 增加期刊paper文章
|
||||
* @description 增加期刊paper文章
|
||||
* @author wangjinlei
|
||||
* @url /master/Journal/addJournalPaperArt
|
||||
* @method POST
|
||||
*
|
||||
* @param name:journal_paper_id type:int require:1 desc:期刊paperid
|
||||
* @param name:journal_id type:int require:1 desc:期刊id
|
||||
* @param name:title type:string require:1 desc:标题
|
||||
* @param name:content type:string require:1 desc:内容
|
||||
*
|
||||
*/
|
||||
public function addJournalPaperArt(){
|
||||
$data = $this->request->post();
|
||||
$insert['journal_paper_id'] = $data['journal_paper_id'];
|
||||
$insert['journal_id'] = $data['journal_id'];
|
||||
$insert['title'] = $data['title'];
|
||||
$insert['content'] = $data['content'];
|
||||
$insert['ctime'] = time();
|
||||
$this->journal_paper_art_obj->insert($insert);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 删除期刊paper文章
|
||||
* @description 删除期刊paper文章
|
||||
* @author wangjinlei
|
||||
* @url /master/Journal/delJournalPaperArt
|
||||
* @method POST
|
||||
*
|
||||
* @param name:journal_paper_art_id type:int require:1 desc:期刊paperid
|
||||
*
|
||||
*/
|
||||
public function delJournalPaperArt(){
|
||||
$data = $this->request->post();
|
||||
$this->journal_paper_art_obj->where('journal_paper_art_id',$data['journal_paper_art_id'])->update(['state'=>1]);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 编辑期刊paper文章
|
||||
* @description 编辑期刊paper文章
|
||||
* @author wangjinlei
|
||||
* @url /master/Journal/editJournalPaperArt
|
||||
* @method POST
|
||||
*
|
||||
* @param name:journal_paper_art_id type:int require:1 desc:期刊paper文章id
|
||||
* @param name:title type:string require:1 desc:标题
|
||||
* @param name:content type:string require:1 desc:内容
|
||||
*
|
||||
*/
|
||||
public function editJournalPaperArt(){
|
||||
$data = $this->request->post();
|
||||
$update['title'] = $data['title'];
|
||||
$update['content'] = $data['content'];
|
||||
$this->journal_paper_art_obj->where('journal_paper_art_id',$data['journal_paper_art_id'])->update($update);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 获取期刊paper文章列表
|
||||
* @description 获取期刊paper文章列表
|
||||
* @author wangjinlei
|
||||
* @url /master/Journal/getJournalPaperArt
|
||||
* @method POST
|
||||
*
|
||||
* @param name:journal_id type:int require:1 desc:期刊paperid
|
||||
*
|
||||
* @return journalInfo:期刊info#
|
||||
* @return paperLists:paperlist#
|
||||
*
|
||||
*/
|
||||
public function getJournalPaperArt(){
|
||||
$data = $this->request->post();
|
||||
$journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
|
||||
$journalPapers = $this->journal_paper_obj->where('journal_id',$data['journal_id'])->where('state',0)->select();
|
||||
foreach ($journalPapers as $k => $v){
|
||||
$cache_list = $this->journal_paper_art_obj->where('journal_paper_id',$v['journal_paper_id'])->where('state',0)->select();
|
||||
$journalPapers[$k]['children'] = $cache_list;
|
||||
}
|
||||
|
||||
$re['journalInfo'] = $journal_info;
|
||||
$re['paperLists'] = $journalPapers;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user