20201112
This commit is contained in:
@@ -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