20201112
This commit is contained in:
76
application/api/controller/Main.php
Normal file
76
application/api/controller/Main.php
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\api\controller;
|
||||||
|
|
||||||
|
use think\Controller;
|
||||||
|
use think\Db;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 前段web接口
|
||||||
|
* @description 前段web接口
|
||||||
|
* @group 前段web接口
|
||||||
|
*/
|
||||||
|
class Main extends Controller{
|
||||||
|
//put your code here
|
||||||
|
protected $admin_obj = '';
|
||||||
|
protected $journal_obj = '';
|
||||||
|
protected $article_obj = '';
|
||||||
|
protected $article_author_obj = '';
|
||||||
|
protected $journal_topic_obj = '';
|
||||||
|
protected $journal_stage_obj = '';
|
||||||
|
protected $journal_notices_obj = '';
|
||||||
|
protected $journal_abs_obj = '';
|
||||||
|
protected $article_to_topic_obj = '';
|
||||||
|
protected $sys_scient_obj = '';
|
||||||
|
protected $sys_book_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->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');
|
||||||
|
$this->sys_scient_obj = Db::name('system_scient');
|
||||||
|
$this->sys_book_obj = Db::name('system_books');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 获取scients
|
||||||
|
* @description 获取scients
|
||||||
|
* @author wangjinlei
|
||||||
|
* @url /api/Main/getScients
|
||||||
|
* @method POST
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @return scients:array#
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function getScients(){
|
||||||
|
$list = $this->sys_scient_obj->where('state',0)->select();
|
||||||
|
$re['scients'] = $list;
|
||||||
|
return jsonSuccess($re);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 获取books
|
||||||
|
* @description 获取books
|
||||||
|
* @author wangjinlei
|
||||||
|
* @url /api/Main/getBooks
|
||||||
|
* @method POST
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @return books:array#
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function getBooks(){
|
||||||
|
$list = $this->sys_book_obj->where('state',0)->select();
|
||||||
|
$re['books'] = $list;
|
||||||
|
return jsonSuccess($re);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -14,7 +14,8 @@ return [
|
|||||||
'app\master\controller\Journal',
|
'app\master\controller\Journal',
|
||||||
'app\master\controller\Article',
|
'app\master\controller\Article',
|
||||||
'app\api\controller\Journal',
|
'app\api\controller\Journal',
|
||||||
'app\api\controller\Article'
|
'app\api\controller\Article',
|
||||||
|
'app\api\controller\Main'
|
||||||
],
|
],
|
||||||
'filter_method' => [
|
'filter_method' => [
|
||||||
//过滤 不解析的方法名称
|
//过滤 不解析的方法名称
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ class Journal extends Controller {
|
|||||||
* @param name:acceptance type:string require:1 desc:受理度
|
* @param name:acceptance type:string require:1 desc:受理度
|
||||||
* @param name:finaldecision type:string require:1 desc:最终受理
|
* @param name:finaldecision type:string require:1 desc:最终受理
|
||||||
* @param name:sort type:int require:1 detault:0 desc:权重值
|
* @param name:sort type:int require:1 detault:0 desc:权重值
|
||||||
|
* @param name:abstract type:string require:1 desc:简介
|
||||||
* @param name:jabbr type:int require:0 desc:期刊简称
|
* @param name:jabbr type:int require:0 desc:期刊简称
|
||||||
* @param name:apc type:string require:1
|
* @param name:apc type:string require:1
|
||||||
* @param name:icon type:string require:1
|
* @param name:icon type:string require:1
|
||||||
@@ -142,6 +143,7 @@ class Journal extends Controller {
|
|||||||
* @param name:acceptance type:string require:1 desc:受理度
|
* @param name:acceptance type:string require:1 desc:受理度
|
||||||
* @param name:finaldecision type:string require:1 desc:最终受理
|
* @param name:finaldecision type:string require:1 desc:最终受理
|
||||||
* @param name:sort type:int require:1 detault:0 desc:权重值
|
* @param name:sort type:int require:1 detault:0 desc:权重值
|
||||||
|
* @param name:abstract type:string require:1 desc:简介
|
||||||
* @param name:jabbr type:string require:0 desc:期刊简称
|
* @param name:jabbr type:string require:0 desc:期刊简称
|
||||||
* @param name:apc type:string require:1
|
* @param name:apc type:string require:1
|
||||||
* @param name:publish_stage_id type:int require:1 desc:推广分期id
|
* @param name:publish_stage_id type:int require:1 desc:推广分期id
|
||||||
@@ -991,30 +993,45 @@ class Journal extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 获取期刊paper文章列表
|
* @title 获取期刊paper
|
||||||
* @description 获取期刊paper文章列表
|
* @description 获取期刊paper
|
||||||
* @author wangjinlei
|
* @author wangjinlei
|
||||||
* @url /master/Journal/getJournalPaperArt
|
* @url /master/Journal/getJournalPapers
|
||||||
* @method POST
|
* @method POST
|
||||||
*
|
*
|
||||||
* @param name:journal_id type:int require:1 desc:期刊paperid
|
* @param name:journal_id type:int require:1 desc:期刊paperid
|
||||||
*
|
*
|
||||||
* @return journalInfo:期刊info#
|
|
||||||
* @return paperLists:paperlist#
|
* @return paperLists:paperlist#
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function getJournalPaperArt(){
|
public function getJournalPapers(){
|
||||||
$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();
|
||||||
$journalPapers = $this->journal_paper_obj->where('journal_id',$data['journal_id'])->where('state',0)->select();
|
$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['journalInfo'] = $journal_info;
|
||||||
$re['paperLists'] = $journalPapers;
|
$re['paperLists'] = $journalPapers;
|
||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 获取期刊paper文章列表
|
||||||
|
* @description 获取期刊paper文章列表
|
||||||
|
* @author wangjinlei
|
||||||
|
* @url /master/Journal/getJournalPaperArt
|
||||||
|
* @method POST
|
||||||
|
*
|
||||||
|
* @param name:journal_paper_id type:int require:1 desc:期刊paperid
|
||||||
|
*
|
||||||
|
* @return articleLists:paperlist#
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function getJournalPaperArt(){
|
||||||
|
$data = $this->request->post();
|
||||||
|
$list = $this->journal_paper_art_obj->where('journal_paper_id',$data['journal_paper_id'])->where('state',0)->select();
|
||||||
|
|
||||||
|
$re['articleLists'] = $list;
|
||||||
|
return jsonSuccess($re);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,12 +14,16 @@ class Mysystem extends Controller {
|
|||||||
protected $admin_obj = '';
|
protected $admin_obj = '';
|
||||||
protected $sys_obj = '';
|
protected $sys_obj = '';
|
||||||
protected $sys_abs_obj = '';
|
protected $sys_abs_obj = '';
|
||||||
|
protected $sys_scient_obj = '';
|
||||||
|
protected $sys_book_obj = '';
|
||||||
|
|
||||||
public function __construct(\think\Request $request = null) {
|
public function __construct(\think\Request $request = null) {
|
||||||
parent::__construct($request);
|
parent::__construct($request);
|
||||||
$this->admin_obj = Db::name('admin');
|
$this->admin_obj = Db::name('admin');
|
||||||
$this->sys_obj = Db::name('system');
|
$this->sys_obj = Db::name('system');
|
||||||
$this->sys_abs_obj = Db::name('system_abstracting');
|
$this->sys_abs_obj = Db::name('system_abstracting');
|
||||||
|
$this->sys_scient_obj = Db::name('system_scient');
|
||||||
|
$this->sys_book_obj = Db::name('system_books');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -167,7 +171,6 @@ class Mysystem extends Controller {
|
|||||||
* @url /master/Mysystem/changeShow
|
* @url /master/Mysystem/changeShow
|
||||||
* @method POST
|
* @method POST
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* @param name:system_abstracting_id type:int require:1 desc:id主键
|
* @param name:system_abstracting_id type:int require:1 desc:id主键
|
||||||
* @param name:is_show type:int require:1 desc:id主键
|
* @param name:is_show type:int require:1 desc:id主键
|
||||||
*/
|
*/
|
||||||
@@ -181,4 +184,196 @@ class Mysystem extends Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 图片上传
|
||||||
|
* @description 图片上传
|
||||||
|
* @author wangjinlei
|
||||||
|
* @url /master/Mysystem/up_file
|
||||||
|
* @method POST
|
||||||
|
*
|
||||||
|
* @param name:name type:string require:1 default:system desc:文件域名称
|
||||||
|
*
|
||||||
|
* @return upurl:图片地址
|
||||||
|
*/
|
||||||
|
public function up_file() {
|
||||||
|
$file = request()->file('system');
|
||||||
|
if ($file) {
|
||||||
|
$info = $file->move(ROOT_PATH . 'public' . DS . 'system');
|
||||||
|
if ($info) {
|
||||||
|
return json(['code'=>0 , 'msg'=>'success', 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
|
||||||
|
} else {
|
||||||
|
return json(['code' => 1, 'msg' => $file->getError()]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 增加scient
|
||||||
|
* @description 增加scient
|
||||||
|
* @author wangjinlei
|
||||||
|
* @url /master/Mysystem/addScient
|
||||||
|
* @method POST
|
||||||
|
*
|
||||||
|
* @param name:name type:string require:1 desc:名字
|
||||||
|
* @param name:intro type:string require:1 desc:简介
|
||||||
|
* @param name:icon type:string require:1 desc:头像
|
||||||
|
*/
|
||||||
|
public function addScient(){
|
||||||
|
$data = $this->request->post();
|
||||||
|
$insert['name'] = $data['name'];
|
||||||
|
$insert['intro'] = $data['intro'];
|
||||||
|
$insert['icon'] = $data['icon'];
|
||||||
|
$this->sys_scient_obj->insert($insert);
|
||||||
|
return jsonSuccess([]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 删除scient
|
||||||
|
* @description 删除scient
|
||||||
|
* @author wangjinlei
|
||||||
|
* @url /master/Mysystem/delScient
|
||||||
|
* @method POST
|
||||||
|
*
|
||||||
|
* @param name:system_scient_id type:int require:1 desc:主键id
|
||||||
|
*/
|
||||||
|
public function delScient(){
|
||||||
|
$data = $this->request->post();
|
||||||
|
$this->sys_scient_obj->where('system_scient_id',$data['system_scient_id'])->update(['state'=>1]);
|
||||||
|
return jsonSuccess([]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 编辑scient
|
||||||
|
* @description 编辑scient
|
||||||
|
* @author wangjinlei
|
||||||
|
* @url /master/Mysystem/editScient
|
||||||
|
* @method POST
|
||||||
|
*
|
||||||
|
* @param name:system_scient_id type:int require:1 desc:主键id
|
||||||
|
* @param name:name type:string require:1 desc:名字
|
||||||
|
* @param name:intro type:string require:1 desc:简介
|
||||||
|
* @param name:icon type:string require:1 desc:头像
|
||||||
|
*/
|
||||||
|
public function editScient(){
|
||||||
|
$data = $this->request->post();
|
||||||
|
$update['name'] = $data['name'];
|
||||||
|
$update['intro'] = $data['intro'];
|
||||||
|
$update['icon'] = $data['icon'];
|
||||||
|
$this->sys_scient_obj->where('system_scient_id',$data['system_scient_id'])->update($update);
|
||||||
|
return jsonSuccess([]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 获取scient
|
||||||
|
* @description 获取scient
|
||||||
|
* @author wangjinlei
|
||||||
|
* @url /master/Mysystem/getScient
|
||||||
|
* @method POST
|
||||||
|
*
|
||||||
|
* @return scients:array#
|
||||||
|
*/
|
||||||
|
public function getScient(){
|
||||||
|
$list = $this->sys_scient_obj->where('state',0)->select();
|
||||||
|
|
||||||
|
$re['scients'] = $list;
|
||||||
|
return jsonSuccess($re);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 增加book
|
||||||
|
* @description 增加book
|
||||||
|
* @author wangjinlei
|
||||||
|
* @url /master/Mysystem/addBook
|
||||||
|
* @method POST
|
||||||
|
*
|
||||||
|
* @param name:title type:string require:1 desc:标题
|
||||||
|
* @param name:language type:string require:1 desc:语言
|
||||||
|
* @param name:author type:string require:1 desc:作者
|
||||||
|
* @param name:isbn type:string require:1
|
||||||
|
* @param name:price type:string require:1
|
||||||
|
* @param name:phone type:string require:1
|
||||||
|
* @param name:icon type:string require:1 desc:书皮图片
|
||||||
|
* @param name:sale_icon type:string require:1 desc:销售二维码
|
||||||
|
* @param name:sale_url type:string require:1 desc:销售链接
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function addBook(){
|
||||||
|
$data = $this->request->post();
|
||||||
|
$insert['title'] = $data['title'];
|
||||||
|
$insert['language'] = $data['language'];
|
||||||
|
$insert['author'] = $data['author'];
|
||||||
|
$insert['isbn'] = $data['isbn'];
|
||||||
|
$insert['price'] = $data['price'];
|
||||||
|
$insert['phone'] = $data['phone'];
|
||||||
|
$insert['icon'] = $data['icon'];
|
||||||
|
$insert['sale_icon'] = $data['sale_icon'];
|
||||||
|
$insert['sale_url'] = $data['sale_url'];
|
||||||
|
$this->sys_book_obj->insert($insert);
|
||||||
|
return jsonSuccess([]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 删除book
|
||||||
|
* @description 删除book
|
||||||
|
* @author wangjinlei
|
||||||
|
* @url /master/Mysystem/delBook
|
||||||
|
* @method POST
|
||||||
|
*
|
||||||
|
* @param name:system_book_id type:int require:1 desc:主键
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function delBook(){
|
||||||
|
$data = $this->request->post();
|
||||||
|
$this->sys_book_obj->where('system_book_id',$data['system_book_id'])->update(['state'=>1]);
|
||||||
|
return jsonSuccess([]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 编辑book
|
||||||
|
* @description 编辑book
|
||||||
|
* @author wangjinlei
|
||||||
|
* @url /master/Mysystem/editBook
|
||||||
|
* @method POST
|
||||||
|
*
|
||||||
|
* $param name:system_book_id type:int require:1 desc:主键
|
||||||
|
* @param name:title type:string require:1 desc:标题
|
||||||
|
* @param name:language type:string require:1 desc:语言
|
||||||
|
* @param name:author type:string require:1 desc:作者
|
||||||
|
* @param name:isbn type:string require:1
|
||||||
|
* @param name:price type:string require:1
|
||||||
|
* @param name:phone type:string require:1
|
||||||
|
* @param name:icon type:string require:1 desc:书皮图片
|
||||||
|
* @param name:sale_icon type:string require:1 desc:销售二维码
|
||||||
|
* @param name:sale_url type:string require:1 desc:销售链接
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function editBook(){
|
||||||
|
$data = $this->request->post();
|
||||||
|
$upload['title'] = $data['title'];
|
||||||
|
$upload['language'] = $data['language'];
|
||||||
|
$upload['author'] = $data['author'];
|
||||||
|
$upload['isbn'] = $data['isbn'];
|
||||||
|
$upload['price'] = $data['price'];
|
||||||
|
$upload['phone'] = $data['phone'];
|
||||||
|
$upload['icon'] = $data['icon'];
|
||||||
|
$upload['sale_icon'] = $data['sale_icon'];
|
||||||
|
$upload['sale_url'] = $data['sale_url'];
|
||||||
|
$this->sys_book_obj->where('system_book_id',$data['system_book_id'])->update($upload);
|
||||||
|
return jsonSuccess([]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 获取book
|
||||||
|
* @description 获取book
|
||||||
|
* @author wangjinlei
|
||||||
|
* @url /master/Mysystem/getBooks
|
||||||
|
* @method POST
|
||||||
|
*
|
||||||
|
* @return books:array#
|
||||||
|
*/
|
||||||
|
public function getBooks(){
|
||||||
|
$list = $this->sys_book_obj->where('state',0)->select();
|
||||||
|
$re['books'] = $list;
|
||||||
|
return jsonSuccess($re);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user