diff --git a/application/common.php b/application/common.php
index 0cb65bd..f3d3b02 100644
--- a/application/common.php
+++ b/application/common.php
@@ -324,7 +324,7 @@ function sendEmail1($email = '', $title = '', $from_name = '', $content = '', $m
}
function aliemail($email,$title,$content){
- file_put_contents('/usr/a.txt', $email,FILE_APPEND);
+ // file_put_contents('/usr/a.txt', $email,FILE_APPEND);
vendor('aliemail.email');
$mailto=$email;
$mailsubject=$title;
diff --git a/application/master/controller/Datebase.php b/application/master/controller/Datebase.php
index 02ac369..76bb185 100644
--- a/application/master/controller/Datebase.php
+++ b/application/master/controller/Datebase.php
@@ -486,6 +486,12 @@ class Datebase extends Controller
}
+
+ public function puttt(){
+ $this->createFtpFileInfo(320);
+ }
+
+
private function createFtpFileInfo($journal_stage_id)
{
//查找分期信息
@@ -635,6 +641,7 @@ class Datebase extends Controller
exit('连接失败');
}
$name = iconv("UTF-8", "GBK", $title . '.zip');
+ ftp_pasv($con, true);
$data = ftp_put($con, '/' . $name, $url, FTP_BINARY);
if (!$data) { // 上传失败
exit('上传失败');
diff --git a/application/master/controller/Journal.php b/application/master/controller/Journal.php
index 44fba09..51b2f3a 100644
--- a/application/master/controller/Journal.php
+++ b/application/master/controller/Journal.php
@@ -12,7 +12,8 @@ use think\Validate;
* @description 期刊相关操作
* @group 期刊相关
*/
-class Journal extends Controller {
+class Journal extends Controller
+{
//put your code here
protected $admin_obj = '';
protected $journal_obj = '';
@@ -34,9 +35,10 @@ class Journal extends Controller {
protected $board_group_obj = '';
protected $base_topic_obj = '';
protected $subscribe_base_topic_obj = '';
- protected $journal_for_author='';
+ protected $journal_for_author = '';
- public function __construct(\think\Request $request = null) {
+ public function __construct(\think\Request $request = null)
+ {
parent::__construct($request);
$this->admin_obj = Db::name('admin');
$this->journal_obj = Db::name('journal');
@@ -60,7 +62,7 @@ class Journal extends Controller {
$this->subscribe_base_topic_obj = Db::name('subscribe_base_topic');
$this->journal_for_author = Db::name('journal_for_author');
}
-
+
/**
* @title 获取期刊列表
* @description 获取期刊列表
@@ -73,26 +75,28 @@ class Journal extends Controller {
* @return journalList:期刊列表@
* @journalList title:标题 issn:issn editorinchief:editorinchief acceptance:acceptance finaldecision:finaldecision apc:apc
*/
- public function getJournalList(){
+ public function getJournalList()
+ {
$data = $this->request->post();
$where['j_journal.state'] = 0;
- if($data['editor_id']!=1){
+ if ($data['editor_id'] != 1) {
$where['j_journal.editor_id'] = $data['editor_id'];
}
$res = $this->journal_obj
- ->field('j_journal.*,j_admin.realname realname')
- ->join('j_admin','j_admin.admin_id = j_journal.editor_id','LEFT')
- ->where($where)
- ->order('j_journal.sort desc')
- ->select();
- return json(['code'=>0,'msg'=>'success','data'=>['journalList'=>$res]]);
+ ->field('j_journal.*,j_admin.realname realname')
+ ->join('j_admin', 'j_admin.admin_id = j_journal.editor_id', 'LEFT')
+ ->where($where)
+ ->order('j_journal.sort desc')
+ ->select();
+ return json(['code' => 0, 'msg' => 'success', 'data' => ['journalList' => $res]]);
}
/**
* 获取全部期刊
*/
- public function getJournals(){
- $jouranls = $this->journal_obj->where('state',0)->select();
+ public function getJournals()
+ {
+ $jouranls = $this->journal_obj->where('state', 0)->select();
$re['journals'] = $jouranls;
return jsonSuccess($re);
}
@@ -100,26 +104,28 @@ class Journal extends Controller {
/**
* 获取分期通过期刊
*/
- public function getStagesByJournal(){
+ public function getStagesByJournal()
+ {
$data = $this->request->post();
$rule = new Validate([
- 'journal_id'=>'require|number'
+ 'journal_id' => 'require|number'
]);
- if(!$rule->check($data)){
+ if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- $list = $this->journal_stage_obj->where('journal_id',$data['journal_id'])->where('state',0)->select();
+ $list = $this->journal_stage_obj->where('journal_id', $data['journal_id'])->where('state', 0)->select();
foreach ($list as $k => $vv) {
$list[$k]['title'] = $vv['stage_year'] . ' Vol.' . $vv['stage_vol'] . ' issue.' . $vv['stage_no'] . $vv['stage_pagename'] . $vv['stage_page'];
}
- $re['stages']=$list;
+ $re['stages'] = $list;
return jsonSuccess($re);
}
/**
* 获取期刊和分期信息
*/
- public function getJournalsAndStage(){
+ public function getJournalsAndStage()
+ {
$data = $this->request->post();
$journal_list = $this->journal_obj->where('state', 0)->select();
$frag = [];
@@ -138,7 +144,7 @@ class Journal extends Controller {
}
return json(['code' => 0, 'msg' => 'success', 'data' => ['joutaglist' => $frag]]);
}
-
+
/**
* @title 获取所有期刊
* @description 获取所有期刊
@@ -150,14 +156,15 @@ class Journal extends Controller {
*
* @return journalList:期刊列表#
*/
- public function getJournalAll(){
+ public function getJournalAll()
+ {
$data = $this->request->post();
- $res = $this->journal_obj->where('journal_id','<>',$data['journal_id'])->where('state',0)->select();
+ $res = $this->journal_obj->where('journal_id', '<>', $data['journal_id'])->where('state', 0)->select();
$re['journalList'] = $res;
return jsonSuccess($re);
}
-
-
+
+
/**
* @title 添加期刊
* @description 添加期刊
@@ -185,7 +192,8 @@ class Journal extends Controller {
* @param name:board_url type:string require:1 desc:编委会地址
* @param name:topic_show_type type:int require:1 desc:0无图片1有图片
*/
- public function addJournal(){
+ public function addJournal()
+ {
$data = $this->request->post();
$insert_data['title'] = $data['title'];
$insert_data['issn'] = $data['issn'];
@@ -207,13 +215,13 @@ class Journal extends Controller {
$insert_data['board_url'] = $data['board_url'];
$insert_data['topic_show_type'] = $data['topic_show_type'];
$res = $this->journal_obj->insert($insert_data);
- if($res){
- return json(['code'=>0,'msg'=>'success']);
- }else{
- return json(['code'=>1,'msg'=>'system error']);
+ if ($res) {
+ return json(['code' => 0, 'msg' => 'success']);
+ } else {
+ return json(['code' => 1, 'msg' => 'system error']);
}
}
-
+
/**
* @title 删除期刊
* @description 删除期刊
@@ -223,19 +231,20 @@ class Journal extends Controller {
*
* @param name:journal_id require:1 desc:主键
*/
- public function delJournal(){
+ public function delJournal()
+ {
$data = $this->request->post();
- $res = $this->journal_obj->where('journal_id',$data['journal_id'])->update(['state'=>1]);
- if($res){
- return json(['code'=>0,'msg'=>'success']);
- }else{
- return json(['code'=>1,'msg'=>'system error']);
+ $res = $this->journal_obj->where('journal_id', $data['journal_id'])->update(['state' => 1]);
+ if ($res) {
+ return json(['code' => 0, 'msg' => 'success']);
+ } else {
+ return json(['code' => 1, 'msg' => 'system error']);
}
}
-
-
-
-
+
+
+
+
/**
* @title 修改期刊详情
* @description 修改期刊详情
@@ -265,7 +274,8 @@ class Journal extends Controller {
* @param name:board_url type:string require:1 desc:编委会地址
* @param name:topic_show_type type:int require:1 desc:0无图片1有图片
*/
- public function editJournalDetail(){
+ public function editJournalDetail()
+ {
$data = $this->request->post();
$insert_data['title'] = $data['title'];
$insert_data['issn'] = $data['issn'];
@@ -287,14 +297,14 @@ class Journal extends Controller {
$insert_data['submission_url'] = $data['submission_url'];
$insert_data['board_url'] = $data['board_url'];
$insert_data['topic_show_type'] = $data['topic_show_type'];
- $res = $this->journal_obj->where('journal_id',$data['journal_id'])->update($insert_data);
-// if($res){
- return json(['code'=>0,'msg'=>'success']);
-// }else{
-// return json(['code'=>1,'msg'=>'Please confirm you have changed the journal information.']);
-// }
+ $res = $this->journal_obj->where('journal_id', $data['journal_id'])->update($insert_data);
+ // if($res){
+ return json(['code' => 0, 'msg' => 'success']);
+ // }else{
+ // return json(['code'=>1,'msg'=>'Please confirm you have changed the journal information.']);
+ // }
}
-
+
/**
* @title 获取编辑列表
* @description 获取编辑列表
@@ -305,11 +315,12 @@ class Journal extends Controller {
* @return editorList:编辑列表@
* @editorList account:账号 realname:真实姓名 role:角色代号(0admin1editor)
*/
- public function getEditorList(){
- $editor_list = $this->admin_obj->where('role',1)->select();
- return json(['code'=>0,'msg'=>'success','data'=>['editorList'=>$editor_list]]);
+ public function getEditorList()
+ {
+ $editor_list = $this->admin_obj->where('role', 1)->select();
+ return json(['code' => 0, 'msg' => 'success', 'data' => ['editorList' => $editor_list]]);
}
-
+
/**
* @title 图片上传
* @description 图片上传
@@ -321,18 +332,19 @@ class Journal extends Controller {
*
* @return upurl:图片地址
*/
- public function up_file() {
+ public function up_file()
+ {
$file = request()->file('journalicon');
if ($file) {
$info = $file->move(ROOT_PATH . 'public' . DS . 'journalicon');
if ($info) {
- return json(['code'=>0 , 'msg'=>'success', 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
+ return json(['code' => 0, 'msg' => 'success', 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
} else {
return json(['code' => 1, 'msg' => $file->getError()]);
}
}
}
-
+
/**
* @title 获取编委列表
* @description 获取编委列表
@@ -345,21 +357,22 @@ class Journal extends Controller {
* @return boards:编委列表array#
* @return journal:期刊信息#
*/
- public function getBoardList(){
+ public function getBoardList()
+ {
$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->board_obj
- ->field('j_board.*,j_board_group.group_name')
- ->join('j_board_group','j_board.board_group_id = j_board_group.board_group_id','LEFT')
- ->where('j_board.journal_id',$data['journal_id'])
- ->where('j_board.state',0)
- ->order('j_board.type')
- ->select();
+ ->field('j_board.*,j_board_group.group_name')
+ ->join('j_board_group', 'j_board.board_group_id = j_board_group.board_group_id', 'LEFT')
+ ->where('j_board.journal_id', $data['journal_id'])
+ ->where('j_board.state', 0)
+ ->order('j_board.type')
+ ->select();
$re['boards'] = $list;
$re['journal'] = $journal_info;
return jsonSuccess($re);
}
-
+
/**
* @title 获取编委成员分类列表
* @description 获取编委成员分类列表
@@ -371,13 +384,14 @@ class Journal extends Controller {
*
* @return groups:编委分类列表array#
*/
- public function getBoardGroups(){
+ public function getBoardGroups()
+ {
$data = $this->request->post();
- $list = $this->board_group_obj->where('journal_id',$data['journal_id'])->where('state',0)->select();
+ $list = $this->board_group_obj->where('journal_id', $data['journal_id'])->where('state', 0)->select();
$re['groups'] = $list;
return jsonSuccess($re);
}
-
+
/**
* @title 添加编委成员分组
* @description 添加编委成员分组
@@ -388,14 +402,15 @@ class Journal extends Controller {
* @param name:journal_id type:int require:1 desc:期刊id
* @param name:group_name type:string require:1 desc:分组名字
*/
- public function addBoardGroup(){
+ public function addBoardGroup()
+ {
$data = $this->request->post();
$insert['journal_id'] = $data['journal_id'];
$insert['group_name'] = $data['group_name'];
$this->board_group_obj->insert($insert);
return jsonSuccess([]);
}
-
+
/**
* @title 删除编委成员分组
* @description 删除编委成员分组
@@ -405,12 +420,13 @@ class Journal extends Controller {
*
* @param name:board_group_id type:int require:1 desc:编委分组id
*/
- public function delBoardGroup(){
+ public function delBoardGroup()
+ {
$data = $this->request->post();
- $this->board_group_obj->where('board_group_id',$data['board_group_id'])->update(['state'=>1]);
+ $this->board_group_obj->where('board_group_id', $data['board_group_id'])->update(['state' => 1]);
return jsonSuccess([]);
}
-
+
/**
* @title 编辑编委成员分组信息
* @description 编辑编委成员分组信息
@@ -421,12 +437,13 @@ class Journal extends Controller {
* @param name:board_group_id type:int require:1 desc:编委分组id
* @param name:group_name type:string require:1 desc:分组名字
*/
- public function editBoardGroup(){
+ public function editBoardGroup()
+ {
$data = $this->request->post();
- $this->board_group_obj->where('board_group_id',$data['board_group_id'])->update(['group_name'=>$data['group_name']]);
+ $this->board_group_obj->where('board_group_id', $data['board_group_id'])->update(['group_name' => $data['group_name']]);
return jsonSuccess([]);
}
-
+
/**
* @title 添加编委
* @description 添加编委
@@ -446,7 +463,8 @@ class Journal extends Controller {
* @param name:country type:string require:1 desc:国家
* @param name:board_group_id type:int require:1 desc:编委分组id
*/
- public function addBoard(){
+ public function addBoard()
+ {
$data = $this->request->post();
$insert['journal_id'] = $data['journal_id'];
$insert['type'] = $data['type'];
@@ -462,7 +480,7 @@ class Journal extends Controller {
$this->board_obj->insert($insert);
return jsonSuccess([]);
}
-
+
/**
* @title 删除编委
* @description 删除编委
@@ -472,12 +490,13 @@ class Journal extends Controller {
*
* @param name:board_id type:int require:1 desc:编委id
*/
- public function delBoard(){
+ public function delBoard()
+ {
$data = $this->request->post();
- $this->board_obj->where('board_id',$data['board_id'])->update(['state'=>1]);
+ $this->board_obj->where('board_id', $data['board_id'])->update(['state' => 1]);
return jsonSuccess([]);
}
-
+
/**
* @title 编辑编委信息
* @description 编辑编委信息
@@ -497,7 +516,8 @@ class Journal extends Controller {
* @param name:country type:string require:1 desc:国家
* @param name:board_group_id type:int require:1 desc:编委分组id
*/
- public function editBoard(){
+ public function editBoard()
+ {
$data = $this->request->post();
$insert['type'] = $data['type'];
$insert['name'] = trim($data['name']);
@@ -509,11 +529,11 @@ class Journal extends Controller {
$insert['board_icon'] = trim($data['board_icon']);
$insert['country'] = $data['country'];
$insert['board_group_id'] = $data['board_group_id'];
-
- $this->board_obj->where('board_id',$data['board_id'])->update($insert);
+
+ $this->board_obj->where('board_id', $data['board_id'])->update($insert);
return jsonSuccess([]);
}
-
+
/**
* @title 增加话题
* @description 增加话题
@@ -531,35 +551,36 @@ class Journal extends Controller {
* @param name:is_final type:int require:1 desc:是否终结点(0no1yes)
* @param name:sort type:int require:1 default:0 desc:权重
*/
- public function addTopic(){
+ public function addTopic()
+ {
$data = $this->request->post();
$level = 0;
- if($data['parent_id']==0){
+ if ($data['parent_id'] == 0) {
$level = 1;
- }else{
- $parent_info = $this->journal_topic_obj->where('journal_topic_id',$data['parent_id'])->find();
- $level = intval($parent_info['level'])+1;
+ } else {
+ $parent_info = $this->journal_topic_obj->where('journal_topic_id', $data['parent_id'])->find();
+ $level = intval($parent_info['level']) + 1;
}
$insert['journal_id'] = $data['journal_id'];
$insert['parent_id'] = $data['parent_id'];
$insert['title'] = $data['title'];
$insert['icon'] = $data['icon'];
$insert['intro'] = $data['intro'];
- $insert['come'] = isset($data['come'])?$data['come']:'';
- if($data['parent_id']==0){
+ $insert['come'] = isset($data['come']) ? $data['come'] : '';
+ if ($data['parent_id'] == 0) {
$insert['position'] = $data['position'];
}
$insert['is_final'] = $data['is_final'];
$insert['sort'] = $data['sort'];
$insert['level'] = $level;
$res = $this->journal_topic_obj->insert($insert);
- if($res){
- return json(['code'=>0,'msg'=>'success']);
- }else{
- return json(['code'=>1,'msg'=>'system error']);
+ if ($res) {
+ return json(['code' => 0, 'msg' => 'success']);
+ } else {
+ return json(['code' => 1, 'msg' => 'system error']);
}
}
-
+
/**
* @title 更改话题信息
* @description 更改话题信息
@@ -576,20 +597,21 @@ class Journal extends Controller {
* @param name:is_final type:int require:1 desc:是否终结点(0no1yes)
* @param name:sort type:int require:1 default:0 desc:权重
*/
- public function editTopic(){
+ public function editTopic()
+ {
$data = $this->request->post();
$update['journal_topic_id'] = $data['journal_topic_id'];
$update['title'] = $data['title'];
$update['icon'] = $data['icon'];
$update['intro'] = $data['intro'];
$update['come'] = $data['come'];
- $update['position'] = isset($data['position'])?$data['position']:'';
+ $update['position'] = isset($data['position']) ? $data['position'] : '';
$update['is_final'] = $data['is_final'];
$update['sort'] = $data['sort'];
$res = $this->journal_topic_obj->update($update);
- return json(['code'=>0,'msg'=>'success']);
+ return json(['code' => 0, 'msg' => 'success']);
}
-
+
/**
* @title 删除话题
* @description 删除话题
@@ -599,23 +621,24 @@ class Journal extends Controller {
*
* @param name:journal_topic_id type:int require:1 desc:主键
*/
- public function delTopic(){
+ public function delTopic()
+ {
$data = $this->request->post();
//排除有子节点的项
- $rep = $this->journal_topic_obj->where('parent_id',$data['journal_topic_id'])->where('state',0)->find();
- if($rep){
- return json(['code'=>1,'msg'=>'删除的话题不能有子节点!']);
+ $rep = $this->journal_topic_obj->where('parent_id', $data['journal_topic_id'])->where('state', 0)->find();
+ if ($rep) {
+ return json(['code' => 1, 'msg' => '删除的话题不能有子节点!']);
}
- $res = $this->journal_topic_obj->where('journal_topic_id',$data['journal_topic_id'])->update(['state'=>1]);
+ $res = $this->journal_topic_obj->where('journal_topic_id', $data['journal_topic_id'])->update(['state' => 1]);
//删除此话题下的话题文章对应关系
- $this->article_to_topic_obj->where('topic_id',$data['journal_topic_id'])->update(['state'=>1]);
- if($res){
- return json(['code'=>0,'msg'=>'success']);
- }else{
- return json(['code'=>1,'msg'=>'system error']);
+ $this->article_to_topic_obj->where('topic_id', $data['journal_topic_id'])->update(['state' => 1]);
+ if ($res) {
+ return json(['code' => 0, 'msg' => 'success']);
+ } else {
+ return json(['code' => 1, 'msg' => 'system error']);
}
}
-
+
/**
* @title 获取话题父级列表
* @description 获取话题父级列表
@@ -627,49 +650,51 @@ class Journal extends Controller {
*
* @return parentList:array#
*/
- public function getParent(){
+ public function getParent()
+ {
$data = $this->request->post();
-// $data['journal_id'] = 9;
+ // $data['journal_id'] = 9;
$res = $this->journal_topic_obj
- ->where('journal_id',$data['journal_id'])
- ->where('state',0)
- ->where('is_final',0)
- ->order('sort desc')
- ->select();
+ ->where('journal_id', $data['journal_id'])
+ ->where('state', 0)
+ ->where('is_final', 0)
+ ->order('sort desc')
+ ->select();
//处理数组
$frag = [];
- foreach ($res as $v){
- if($v['parent_id'] == 0){
- $frag[] = $v;
- }
+ foreach ($res as $v) {
+ if ($v['parent_id'] == 0) {
+ $frag[] = $v;
+ }
}
$ff = [];
- foreach ($frag as $kk => $vv){
+ foreach ($frag as $kk => $vv) {
$ff[] = $this->getpChieldarr($vv, $res);
-// $frag[$kk] = $this->getChieldarr($vv,$res);
+ // $frag[$kk] = $this->getChieldarr($vv,$res);
}
$fff = [];
- foreach ($ff as $vvv){
- foreach ($vvv as $vvvv){
+ foreach ($ff as $vvv) {
+ foreach ($vvv as $vvvv) {
$fff[] = $vvvv;
}
}
- return json(['code'=>0,'msg'=>'success','data'=>['parentList'=>$fff]]);
+ return json(['code' => 0, 'msg' => 'success', 'data' => ['parentList' => $fff]]);
}
- private function getpChieldarr($vv,$res){
- if($vv['is_final']==1){
+ private function getpChieldarr($vv, $res)
+ {
+ if ($vv['is_final'] == 1) {
return $vv;
}
$frag = [];
$frag[] = $vv;
- foreach ($res as $v){
- if($v['parent_id'] == $vv['journal_topic_id']){
+ foreach ($res as $v) {
+ if ($v['parent_id'] == $vv['journal_topic_id']) {
$frag[] = $this->getChieldarr($v, $res);
}
}
return $frag;
}
-
+
/**
* @title 获取话题列表
* @description 获取话题列表
@@ -683,37 +708,39 @@ class Journal extends Controller {
* @return topicList:话题数组@
* @topicList array:数据
*/
- public function getTopicList(){
+ public function getTopicList()
+ {
$data = $this->request->post();
$res = $this->journal_topic_obj
- ->where('journal_id',$data['journal_id'])
- ->where('state',0)
- ->select();
- $journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
+ ->where('journal_id', $data['journal_id'])
+ ->where('state', 0)
+ ->select();
+ $journal_info = $this->journal_obj->where('journal_id', $data['journal_id'])->find();
//处理数组
$frag = [];
- foreach ($res as $v){
- if($v['parent_id'] == 0){
- $frag[] = $v;
- }
+ foreach ($res as $v) {
+ if ($v['parent_id'] == 0) {
+ $frag[] = $v;
+ }
}
- foreach ($frag as $kk => $vv){
- $frag[$kk] = $this->getChieldarr($vv,$res);
+ foreach ($frag as $kk => $vv) {
+ $frag[$kk] = $this->getChieldarr($vv, $res);
}
- return json(['code'=>0,'msg'=>'success','data'=>['journal'=>$journal_info,'topicList'=>$frag]]);
+ return json(['code' => 0, 'msg' => 'success', 'data' => ['journal' => $journal_info, 'topicList' => $frag]]);
}
- private function getChieldarr($vv,$res){
- if($vv['is_final']==1){
+ private function getChieldarr($vv, $res)
+ {
+ if ($vv['is_final'] == 1) {
return $vv;
}
- foreach ($res as $v){
- if($v['parent_id'] == $vv['journal_topic_id']){
+ foreach ($res as $v) {
+ if ($v['parent_id'] == $vv['journal_topic_id']) {
$vv['children'][] = $this->getChieldarr($v, $res);
}
}
return $vv;
}
-
+
/**
* @title 添加话题的文章
* @description 添加话题的文章
@@ -724,46 +751,145 @@ class Journal extends Controller {
* @param name:article_id type:int require:1 desc:文章id
* @param name:topic_id type:int require:1 desc:话题id
*/
- public function addTopicArticle(){
+ public function addTopicArticle()
+ {
$data = $this->request->post();
$insert['article_id'] = $data['article_id'];
$insert['topic_id'] = $data['topic_id'];
$res = $this->article_to_topic_obj->insert($insert);
$this->msg_subscript_topic($data['topic_id'], $data['article_id']);
$this->msg_subscribe_base_topic($data['topic_id'], $data['article_id']);
- if($res){
- return json(['code'=>0,'msg'=>'success']);
- }else{
- return json(['code'=>1,'msg'=>'system error']);
+ if ($res) {
+ return json(['code' => 0, 'msg' => 'success']);
+ } else {
+ return json(['code' => 1, 'msg' => 'system error']);
}
}
-
-
- public function mmm(){
+
+ /**
+ * 发送邮件至审稿人
+ */
+ public function pushEmailToReviewer()
+ {
+ $data = $this->request->post();
+ $topic_tem = Db::name('topic_tem');
+ $tems = $topic_tem->where('topic_id', $data['topic'])->where('state', 0)->select();
+ $frag = [];
+ foreach ($tems as $k => $v) {
+ $url = "http://api.tmrjournals.com/public/index.php/api/Reviewer/getRevEmailByTopic";
+ $pag = [];
+ $pag['topic'] = $v['p_title'];
+ $cache_res = object_to_array(json_decode(myPost($url, $pag)));
+ if($cache_res['code']==0){
+ $emails =$cache_res['data']['reviewers'];
+ foreach($emails as $val){
+ $frag[] = $val['email'];
+ }
+ }
+ }
+ $article_ids = $this->article_to_topic_obj->where('topic_id', $data['topic'])->where('state', 0)->column('article_id');
+ $articles = $this->article_obj
+ ->field('j_article.*,j_journal_stage.stage_year,j_journal_stage.stage_vol,j_journal_stage.stage_no')
+ ->join('j_journal_stage', 'j_journal_stage.journal_stage_id = j_article.journal_stage_id', 'left')
+ ->where('j_journal_stage.stage_year', '>=', '2020')
+ ->where('j_article.article_id', 'in', $article_ids)
+ ->where('j_article.journal_id',1)
+ ->where('j_article.state', 0)
+ ->select();
+ $tt = 'Greetings!
';
+ $tt .= 'Thank you for your contribution to TMR Publishing Group and your active participation in the peer review process.
';
+ $tt .= "According to Clarivate's latest policy (https://clarivate.com/news/clarivate-announces-changes-to-the-2023-journal-citation-reports/), Traditional Medicine Research (ISSN 2413-3973) will get the first Impact Factor in 2023. You are welcome to pay attention to the journal and submit manuscripts.Attached are some papers published in Traditional Medicine Research, which are related to your research field. You are always welcome to read and to share the articles and encourage you to submit your manuscripts to us through the following channels: www.tmrjournals.com/tmr
";
+ foreach($articles as $v){
+ $tt .= "".$v['title']."
";
+ $tt .= "Traditional Medicine Research. ".$v['stage_year']." ".$v['stage_vol']."(".$v['stage_no'].")
";
+ $tt .= "Download pdf
";
+ }
+
+
+ $frag1 = [];
+ $frag1[] = '751475802@qq.com';
+ $frag1[] = '849192806@qq.com';
+ $frag1[] = '13662001490@126.com';
+
+ foreach($frag as $v){
+ $maidata['email'] = $v;
+ $maidata['title'] = "Traditional Medicine Research will get the first Impact Factor (WOS) in 2023";
+ $maidata['content'] = $tt;
+ // $maidata['tmail'] = 'publicrelations@tmrjournals.com';
+ // $maidata['tpassword'] = 'pRWU999999';
+ // $maidata['tmail'] = 'ghr@tmrjournals.com';
+ // $maidata['tpassword'] = 'Gh999666';
+ // echo aliemail($maidata['email'], $maidata['title'], $maidata['content']);
+ Queue::push('app\api\job\mail@propa', $maidata, "mail");
+ // sendEmail($maidata['email'],$maidata['title'],$maidata['title'],$maidata['content'],$maidata['tmail'],$maidata['tpassword']);
+ }
+ return jsonSuccess(['num'=>count($frag)]);
+ }
+
+
+ // public function toReviewerEmail()//$email, $topic_id)
+ // {
+ // $data = $this->request->post();
+ // $article_ids = $this->article_to_topic_obj->where('topic_id', $data['topic_id'])->where('state', 0)->column('article_id');
+
+ // $articles = $this->article_obj
+ // ->field('j_article.*,j_journal_stage.stage_year,j_journal_stage.stage_vol,j_journal_stage.stage_no')
+ // ->join('j_journal_stage', 'j_journal_stage.journal_stage_id = j_article.journal_stage_id', 'left')
+ // ->where('j_journal_stage.stage_year', '>=', '2020')
+ // ->where('j_article.article_id', 'in', $article_ids)
+ // ->where('j_article.journal_id',1)
+ // ->where('j_article.state', 0)
+ // ->select();
+ // $tt = 'Greetings!
';
+ // $tt .= 'Thank you for your contribution to TMR Publishing Group and your active participation in the peer review process.
';
+ // $tt .= "According to Clarivate's latest policy (https://clarivate.com/news/clarivate-announces-changes-to-the-2023-journal-citation-reports/), Traditional Medicine Research (ISSN 2413-3973) will get the first Impact Factor in 2023. You are welcome to pay attention to the journal and submit manuscripts.Attached are some papers published in Traditional Medicine Research, which are related to your research field. You are always welcome to read and to share the articles and encourage you to submit your manuscripts to us through the following channels: www.tmrjournals.com/tmr
";
+ // foreach($articles as $v){
+ // $tt .= "".$v['title']."
";
+ // $tt .= "Traditional Medicine Research. ".$v['stage_year']." ".$v['stage_vol']."(".$v['stage_no'].")
";
+ // $tt .= "Download pdf
";
+ // }
+
+
+
+ // $maidata['email'] = $data['email'];
+ // $maidata['title'] = "Traditional Medicine Research will get the first Impact Factor (WOS) in 2023";
+ // $maidata['content'] = $tt;
+ // $maidata['tmail'] = 'publicrelations@tmrjournals.com';
+ // $maidata['tpassword'] = 'pRWU999999';
+ // echo sendEmail($maidata['email'],$maidata['title'],$maidata['title'],$maidata['content'],$maidata['tmail'],$maidata['tpassword']);
+ // // Queue::push('app\api\job\mail@fire', $maidata, "mail");
+ // }
+
+
+
+
+ public function mmm()
+ {
$this->msg_subscribe_base_topic(14, 5);
}
-
-
- private function msg_subscribe_base_topic($topic_id,$article_id){
- $article_info = $this->article_obj->where('article_id',$article_id)->find();
- $topic_info = $this->journal_topic_obj->where('journal_topic_id',$topic_id)->find();
- $base_topic_info = $this->base_topic_obj->where('title',$topic_info['title'])->find();
- $journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find();
- if($base_topic_info==null){
- return ;
+
+
+ private function msg_subscribe_base_topic($topic_id, $article_id)
+ {
+ $article_info = $this->article_obj->where('article_id', $article_id)->find();
+ $topic_info = $this->journal_topic_obj->where('journal_topic_id', $topic_id)->find();
+ $base_topic_info = $this->base_topic_obj->where('title', $topic_info['title'])->find();
+ $journal_info = $this->journal_obj->where('journal_id', $article_info['journal_id'])->find();
+ if ($base_topic_info == null) {
+ return;
}
- $list = $this->subscribe_base_topic_obj->where('base_topic_id',$base_topic_info['base_topic_id'])->where('state',0)->select();
-
+ $list = $this->subscribe_base_topic_obj->where('base_topic_id', $base_topic_info['base_topic_id'])->where('state', 0)->select();
+
$title = 'These new articles included in TMRDE database are available online.';
$tt = 'Dear Researcher,
';
$tt .= 'It is our great honor to present you the articles included in TMRDE.The following new articles have just been included.
';
- $tt .= ''.$article_info['title'].'
';
- foreach ($list as $v){
- $tt1='';
+ $tt .= '' . $article_info['title'] . '
';
+ foreach ($list as $v) {
+ $tt1 = '';
$tt1 .= $tt;
$tt1 .= 'Unsubscribe
';
- $tt1 .= 'Email:'.$journal_info['email'].'
';
- $tt1 .= 'Website:'.$journal_info['website'].'
';
+ $tt1 .= 'Email:' . $journal_info['email'] . '
';
+ $tt1 .= 'Website:' . $journal_info['website'] . '
';
$tt1 .= 'TMR Publishing Group Ltd.
';
$tt1 .= '11 Cockle Bay Rd, Cockle Bay, Auckland, New Zealand
';
$tt1 .= 'Tel: +64 02108293806.';
@@ -774,21 +900,21 @@ class Journal extends Controller {
$maidata['tpassword'] = 'pRWU999999';
Queue::push('app\api\job\mail@fire', $maidata, "mail");
}
-
}
-
- private function msg_subscript_topic($topic_id,$article_id){
- $article_info = $this->article_obj->where('article_id',$article_id)->find();
+
+ private function msg_subscript_topic($topic_id, $article_id)
+ {
+ $article_info = $this->article_obj->where('article_id', $article_id)->find();
$stage_info = $this->journal_stage_obj->where('journal_stage_id', $article_info['journal_stage_id'])->find();
- $topic_info = $this->journal_topic_obj->where('journal_topic_id',$topic_id)->find();
- $journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find();
+ $topic_info = $this->journal_topic_obj->where('journal_topic_id', $topic_id)->find();
+ $journal_info = $this->journal_obj->where('journal_id', $article_info['journal_id'])->find();
$list = [];
- if($topic_info['level']==2){
- $list = $this->subscribe_topic_obj->where('topic_id',$topic_id)->where('state',0)->select();
- }else{
- $list = $this->subscribe_topic_obj->where('topic_id',$topic_info['parent_id'])->where('state',0)->select();
+ if ($topic_info['level'] == 2) {
+ $list = $this->subscribe_topic_obj->where('topic_id', $topic_id)->where('state', 0)->select();
+ } else {
+ $list = $this->subscribe_topic_obj->where('topic_id', $topic_info['parent_id'])->where('state', 0)->select();
}
-// $list = $this->subscribe_topic_obj->where('topic_id',$topic_info['parent_id'])->where('state',0)->select();
+ // $list = $this->subscribe_topic_obj->where('topic_id',$topic_info['parent_id'])->where('state',0)->select();
//组成文章信息
$tt1 = '
';
- $tt1 .= $journal_info['title'].'
';
- $tt1 .= 'The following new articles have just been published in Topic "'.$topic_info['title'].'" of '.$journal_info['title'].'
';
- $tt1 .= $article_info['type'].'
';
- $tt1 .= '
'.$article_info['title'].'';
- $tt1 .= $this->getAuthor($article_info).'
';
- $tt1 .= $journal_info['title'].' '.$stage_info['stage_year'].' '.$stage_info['stage_vol']."(".$stage_info['stage_no']."). https://doi.org/".$article_info['doi'].'
';
- $tt1 .= '
Download pdf';
-
- $tt2 = 'Email: '.$journal_info['email'].'
';
- $tt2 .= 'Website: https://www.tmrjournals.com/'.$journal_info['usx'].'
';
+ $tt1 .= $journal_info['title'] . '
';
+ $tt1 .= 'The following new articles have just been published in Topic "' . $topic_info['title'] . '" of ' . $journal_info['title'] . '
';
+ $tt1 .= $article_info['type'] . '
';
+ $tt1 .= '
' . $article_info['title'] . '';
+ $tt1 .= $this->getAuthor($article_info) . '
';
+ $tt1 .= $journal_info['title'] . ' ' . $stage_info['stage_year'] . ' ' . $stage_info['stage_vol'] . "(" . $stage_info['stage_no'] . "). https://doi.org/" . $article_info['doi'] . '
';
+ $tt1 .= '
Download pdf';
+
+ $tt2 = 'Email: ' . $journal_info['email'] . '
';
+ $tt2 .= 'Website: https://www.tmrjournals.com/' . $journal_info['usx'] . '
';
$tt2 .= 'TMR Publishing Group Ltd.
';
$tt2 .= '11 Cockle Bay Rd, Cockle Bay, Auckland, New Zealand
';
$tt2 .= 'Tel: +64 02108293806.';
$tt2 .= '
';
-
- foreach ($list as $v){
- $cache = $tt1.'Unsubscribe
'.$tt2;
+
+ foreach ($list as $v) {
+ $cache = $tt1 . 'Unsubscribe
' . $tt2;
$maidata['email'] = $v['email'];
$maidata['title'] = $journal_info['title'];
$maidata['content'] = $cache;
@@ -828,7 +954,7 @@ class Journal extends Controller {
Queue::push('app\api\job\mail@fire', $maidata, "mail");
}
}
-
+
/**
* @title 获取当前话题的文章
* @description 获取当前话题的文章
@@ -841,18 +967,19 @@ class Journal extends Controller {
* @return dataList:array#
* @return topic:array#
*/
- public function getTopicArticles(){
+ public function getTopicArticles()
+ {
$data = $this->request->post();
$list = $this->article_to_topic_obj
- ->field('j_article_to_topic.*,j_article.*')
- ->join('j_article','j_article.article_id = j_article_to_topic.article_id','LEFT')
- ->where('j_article_to_topic.topic_id',$data['topic_id'])
- ->where('j_article_to_topic.state',0)
- ->select();
- $info = $this->journal_topic_obj->where('journal_topic_id',$data['topic_id'])->find();
- return json(['code'=>0,'msg'=>'success','data'=>['topic'=>$info,'dataList'=>$list]]);
+ ->field('j_article_to_topic.*,j_article.*')
+ ->join('j_article', 'j_article.article_id = j_article_to_topic.article_id', 'LEFT')
+ ->where('j_article_to_topic.topic_id', $data['topic_id'])
+ ->where('j_article_to_topic.state', 0)
+ ->select();
+ $info = $this->journal_topic_obj->where('journal_topic_id', $data['topic_id'])->find();
+ return json(['code' => 0, 'msg' => 'success', 'data' => ['topic' => $info, 'dataList' => $list]]);
}
-
+
/**
* @title 获取当前期刊的文章
* @description 获取当前期刊的文章
@@ -868,16 +995,17 @@ class Journal extends Controller {
*
* @return dataList:array#
*/
- public function getArticleByJournal(){
+ public function getArticleByJournal()
+ {
$data = $this->request->post();
//排除stage
- $ids = $this->article_to_topic_obj->where('topic_id',$data['topic_id'])->where('state',0)->column('article_id');
+ $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)->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]]);
+ $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]]);
}
-
+
/**
* @title 删除文章话题关系
* @description 删除文章话题关系
@@ -888,16 +1016,17 @@ class Journal extends Controller {
* @param name:article_to_topic_id type:int require:1 desc:id
*
*/
- public function delArticleToTopic(){
+ public function delArticleToTopic()
+ {
$data = $this->request->post();
- $res = $this->article_to_topic_obj->where('article_to_topic_id',$data['article_to_topic_id'])->update(['state'=>1]);
- if($res){
- return json(['code'=>0,'msg'=>'success']);
- }else{
- return json(['code'=>1,'msg'=>'system error']);
+ $res = $this->article_to_topic_obj->where('article_to_topic_id', $data['article_to_topic_id'])->update(['state' => 1]);
+ if ($res) {
+ return json(['code' => 0, 'msg' => 'success']);
+ } else {
+ return json(['code' => 1, 'msg' => 'system error']);
}
}
-
+
/**
* @title 添加期刊外链
* @description 添加期刊外链
@@ -911,7 +1040,8 @@ class Journal extends Controller {
* @param name:sort type:int require:1 default:0 desc:权重
* @param name:is_show type:int require:1 default:1 desc:是否显示(1yes0no)
*/
- public function addJournalAbs(){
+ public function addJournalAbs()
+ {
$data = $this->request->post();
$add_data['journal_id'] = $data['journal_id'];
$add_data['title'] = $data['title'];
@@ -919,13 +1049,13 @@ class Journal extends Controller {
$add_data['sort'] = $data['sort'];
$add_data['is_show'] = $data['is_show'];
$res = $this->journal_abs_obj->insert($add_data);
- if($res){
- return json(['code'=>0,'msg'=>'success']);
- }else{
- return json(['code'=>1,'msg'=>'system error!']);
+ if ($res) {
+ return json(['code' => 0, 'msg' => 'success']);
+ } else {
+ return json(['code' => 1, 'msg' => 'system error!']);
}
}
-
+
/**
* @title 删除期刊外链
* @description 删除期刊外链
@@ -935,12 +1065,13 @@ class Journal extends Controller {
*
* @param name:journal_abstracting_id type:int require:1 desc:期刊外链id
*/
- public function delJournalAbs(){
+ public function delJournalAbs()
+ {
$data = $this->request->post();
- $this->journal_abs_obj->where('journal_abstracting_id',$data['journal_abstracting_id'])->update(['state'=>1]);
- return json(['code'=>0,'msg'=>'success']);
+ $this->journal_abs_obj->where('journal_abstracting_id', $data['journal_abstracting_id'])->update(['state' => 1]);
+ return json(['code' => 0, 'msg' => 'success']);
}
-
+
/**
* @title 编辑期刊外链
* @description 编辑期刊外链
@@ -955,12 +1086,13 @@ class Journal extends Controller {
* @param name:sort type:int require:1 default:0 desc:权重
* @param name:is_show type:int require:1 default:1 desc:是否显示(1yes0no)
*/
- public function editJournalAbs(){
+ public function editJournalAbs()
+ {
$data = $this->request->post();
$this->journal_abs_obj->update($data);
- return json(['code'=>0,'msg'=>'success']);
+ return json(['code' => 0, 'msg' => 'success']);
}
-
+
/**
* @title 获取期刊外链
* @description 获取期刊外链
@@ -970,13 +1102,14 @@ class Journal extends Controller {
*
* @param name:journal_id type:int require:1 desc:期刊id
*/
- public function getJournalAbs(){
+ public function getJournalAbs()
+ {
$data = $this->request->post();
- $journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
- $list = $this->journal_abs_obj->where('journal_id',$data['journal_id'])->where('state',0)->order('sort desc')->select();
- return json(['code'=>0,'msg'=>'success','data'=>['journal'=>$journal_info,'absList'=>$list]]);
+ $journal_info = $this->journal_obj->where('journal_id', $data['journal_id'])->find();
+ $list = $this->journal_abs_obj->where('journal_id', $data['journal_id'])->where('state', 0)->order('sort desc')->select();
+ return json(['code' => 0, 'msg' => 'success', 'data' => ['journal' => $journal_info, 'absList' => $list]]);
}
-
+
/**
* @title topic图片上传
* @description topic图片上传
@@ -988,19 +1121,20 @@ class Journal extends Controller {
*
* @return upurl:图片地址
*/
- public function up_topic_file() {
+ public function up_topic_file()
+ {
$file = request()->file('journaltopic');
if ($file) {
$info = $file->move(ROOT_PATH . 'public' . DS . 'journaltopic');
if ($info) {
- return json(['code'=>0 , 'msg'=>'success', 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
+ return json(['code' => 0, 'msg' => 'success', 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
} else {
return json(['code' => 1, 'msg' => $file->getError()]);
}
}
}
-
-
+
+
/**
* @title 编委头像上传
* @description 编委头像上传
@@ -1012,12 +1146,13 @@ class Journal extends Controller {
*
* @return upurl:图片地址
*/
- public function up_board_file() {
+ public function up_board_file()
+ {
$file = request()->file('boardIcon');
if ($file) {
$info = $file->move(ROOT_PATH . 'public' . DS . 'boardIcon');
if ($info) {
- return json(['code'=>0 , 'msg'=>'success', 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
+ return json(['code' => 0, 'msg' => 'success', 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
} else {
return json(['code' => 1, 'msg' => $file->getError()]);
}
@@ -1027,7 +1162,8 @@ class Journal extends Controller {
/**
* 获取期刊forAuthor
*/
- public function getForAuthorList(){
+ public function getForAuthorList()
+ {
$data = $this->request->post();
// 验证规则
$rule = new Validate([
@@ -1036,14 +1172,14 @@ class Journal extends Controller {
if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- $journals[]=0;
- if($data['journal_id']!=0){
- $journals[]=$data['journal_id'];
+ $journals[] = 0;
+ if ($data['journal_id'] != 0) {
+ $journals[] = $data['journal_id'];
}
- $list = $this->journal_for_author->where('journal_id','in',$journals)->where('pid',0)->where('jfa_state',0)->order("sort desc")->select();
- foreach($list as $k => $v){
- $cache_list = $this->journal_for_author->where('journal_id','in',$journals)->where('pid',$v['jfa_id'])->where('jfa_state',0)->order("sort desc")->select();
- foreach($cache_list as $key => $val){
+ $list = $this->journal_for_author->where('journal_id', 'in', $journals)->where('pid', 0)->where('jfa_state', 0)->order("sort desc")->select();
+ foreach ($list as $k => $v) {
+ $cache_list = $this->journal_for_author->where('journal_id', 'in', $journals)->where('pid', $v['jfa_id'])->where('jfa_state', 0)->order("sort desc")->select();
+ foreach ($cache_list as $key => $val) {
$cache_list[$key]['p_title'] = $v['jfa_title'];
}
$list[$k]['children'] = $cache_list;
@@ -1055,13 +1191,14 @@ class Journal extends Controller {
/**
* 添加forauthor
*/
- public function addForAuthor(){
+ public function addForAuthor()
+ {
$data = $this->request->post();
// 验证规则
$rule = new Validate([
'journal_id' => 'require',
- 'pid'=>'require',
- 'jfa_title'=>'require'
+ 'pid' => 'require',
+ 'jfa_title' => 'require'
]);
if (!$rule->check($data)) {
return jsonError($rule->getError());
@@ -1070,7 +1207,7 @@ class Journal extends Controller {
$insert['pid'] = $data['pid'];
$insert['jfa_title'] = $data['jfa_title'];
$insert['content'] = $data['content'];
- $insert['sort'] = isset($data['sort'])?$data['sort']:0;
+ $insert['sort'] = isset($data['sort']) ? $data['sort'] : 0;
$insert['jfa_ctime'] = time();
$this->journal_for_author->insert($insert);
return jsonSuccess([]);
@@ -1079,13 +1216,14 @@ class Journal extends Controller {
/**
* 编辑forauthor
*/
- public function editForAuthor(){
+ public function editForAuthor()
+ {
$data = $this->request->post();
// 验证规则
$rule = new Validate([
'jfa_id' => 'require',
- 'jfa_title'=>'require',
- 'sort'=>'require'
+ 'jfa_title' => 'require',
+ 'sort' => 'require'
]);
if (!$rule->check($data)) {
return jsonError($rule->getError());
@@ -1093,14 +1231,15 @@ class Journal extends Controller {
$update['jfa_title'] = $data['jfa_title'];
$update['content'] = $data['content'];
$update['sort'] = $data['sort'];
- $this->journal_for_author->where('jfa_id',$data['jfa_id'])->update($update);
+ $this->journal_for_author->where('jfa_id', $data['jfa_id'])->update($update);
return jsonSuccess([]);
}
/**
* 删除forAuthor
*/
- public function delForAuthor(){
+ public function delForAuthor()
+ {
$data = $this->request->post();
// 验证规则
$rule = new Validate([
@@ -1109,10 +1248,10 @@ class Journal extends Controller {
if (!$rule->check($data)) {
return jsonError($rule->getError());
}
- $this->journal_for_author->where('jfa_id',$data['jfa_id'])->update(['jfa_state'=>1]);
+ $this->journal_for_author->where('jfa_id', $data['jfa_id'])->update(['jfa_state' => 1]);
return jsonSuccess([]);
}
-
+
/**
* @title line图片上传
* @description line图片上传
@@ -1124,18 +1263,19 @@ class Journal extends Controller {
*
* @return upurl:图片地址
*/
- public function up_line_file() {
+ public function up_line_file()
+ {
$file = request()->file('journalline');
if ($file) {
$info = $file->move(ROOT_PATH . 'public' . DS . 'journalline');
if ($info) {
- return json(['code'=>0 , 'msg'=>'success', 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
+ return json(['code' => 0, 'msg' => 'success', 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
} else {
return json(['code' => 1, 'msg' => $file->getError()]);
}
}
}
-
+
/**
* @title footer图片上传
* @description footer图片上传
@@ -1147,18 +1287,19 @@ class Journal extends Controller {
*
* @return upurl:图片地址
*/
- public function up_footer_file() {
+ public function up_footer_file()
+ {
$file = request()->file('journalfooter');
if ($file) {
$info = $file->move(ROOT_PATH . 'public' . DS . 'journalfooter');
if ($info) {
- return json(['code'=>0 , 'msg'=>'success', 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
+ return json(['code' => 0, 'msg' => 'success', 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
} else {
return json(['code' => 1, 'msg' => $file->getError()]);
}
}
}
-
+
/**
* @title 添加期刊分期
* @description 添加期刊分期
@@ -1176,7 +1317,8 @@ class Journal extends Controller {
* @param name:issue_date type:string require:1 desc:发布时间
* @param name:stage_icon type:string require:0 desc:期刊封面url
*/
- public function addStage(){
+ public function addStage()
+ {
$data = $this->request->post();
$insert_data['journal_id'] = $data['journal_id'];
$insert_data['stage_year'] = $data['stage_year'];
@@ -1185,17 +1327,17 @@ class Journal extends Controller {
$insert_data['stage_pagename'] = $data['stage_pagename'];
$insert_data['stage_page'] = $data['stage_page'];
$insert_data['issue_date'] = $data['issue_date'];
- if(isset($data['stage_icon']) && !empty($data['stage_icon'])){
+ if (isset($data['stage_icon']) && !empty($data['stage_icon'])) {
$insert_data['stage_icon'] = $data['stage_icon'];
}
$res = $this->journal_stage_obj->insert($insert_data);
- if($res){
- return json(['code'=>0,'msg'=>'success']);
- }else{
- return json(['code'=>1,'msg'=>'system error']);
+ if ($res) {
+ return json(['code' => 0, 'msg' => 'success']);
+ } else {
+ return json(['code' => 1, 'msg' => 'system error']);
}
}
-
+
/**
* @title 获取期刊分期
* @description 获取期刊分期
@@ -1208,13 +1350,14 @@ class Journal extends Controller {
* @return journal:array#
* @return stage_list:array#
*/
- public function getStageList(){
+ public function getStageList()
+ {
$data = $this->request->post();
- $journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
- $stage_list = $this->journal_stage_obj->where('journal_id',$data['journal_id'])->where('state',0)->order('journal_stage_id desc')->select();
- return json(['code'=>0,'msg'=>'success','data'=>['journal'=>$journal_info,'stage_list'=>$stage_list]]);
+ $journal_info = $this->journal_obj->where('journal_id', $data['journal_id'])->find();
+ $stage_list = $this->journal_stage_obj->where('journal_id', $data['journal_id'])->where('state', 0)->order('journal_stage_id desc')->select();
+ return json(['code' => 0, 'msg' => 'success', 'data' => ['journal' => $journal_info, 'stage_list' => $stage_list]]);
}
-
+
/**
* @title 删除期刊分期
* @description 删除期刊分期
@@ -1224,16 +1367,17 @@ class Journal extends Controller {
*
* @param name:journal_stage_id type:int require:1 desc:期刊分期id
*/
- public function delStage(){
+ public function delStage()
+ {
$data = $this->request->post();
- $res = $this->journal_stage_obj->where('journal_stage_id',$data['journal_stage_id'])->update(['state'=>1]);
- if($res){
- return json(['code'=>0,'msg'=>'success']);
- }else{
- return json(['code'=>1,'msg'=>'system error']);
+ $res = $this->journal_stage_obj->where('journal_stage_id', $data['journal_stage_id'])->update(['state' => 1]);
+ if ($res) {
+ return json(['code' => 0, 'msg' => 'success']);
+ } else {
+ return json(['code' => 1, 'msg' => 'system error']);
}
}
-
+
/**
* @title 更改期刊分期
* @description 更改期刊分期
@@ -1251,33 +1395,36 @@ class Journal extends Controller {
* @param name:issue_date type:string require:1 desc:发布时间
* @param name:stage_icon type:string require:0 desc:封面url
*/
- public function editStage(){
+ public function editStage()
+ {
$data = $this->request->post();
- $old = $this->journal_stage_obj->where('journal_stage_id',$data['journal_stage_id'])->find();
+ $old = $this->journal_stage_obj->where('journal_stage_id', $data['journal_stage_id'])->find();
$res = $this->journal_stage_obj->update($data);
//是否提醒订阅者
- if($old['is_publish']==0&&$data['is_publish']==1){
- $this->msg_subscript_journal($data['journal_stage_id'],$old['journal_id']);
+ if ($old['is_publish'] == 0 && $data['is_publish'] == 1) {
+ $this->msg_subscript_journal($data['journal_stage_id'], $old['journal_id']);
// 提醒作者 发送邮件
- $this->sendAuthor($data['journal_stage_id'],$old['journal_id']);
+ $this->sendAuthor($data['journal_stage_id'], $old['journal_id']);
}
- if($res){
- return json(['code'=>0,'msg'=>'success']);
- }else{
- return json(['code'=>1,'msg'=>'system error']);
+ if ($res) {
+ return json(['code' => 0, 'msg' => 'success']);
+ } else {
+ return json(['code' => 1, 'msg' => 'system error']);
}
}
-
- public function myttt(){
-// $this->msg_subscript_journal(320, 1);
+
+ public function myttt()
+ {
+ // $this->msg_subscript_journal(320, 1);
}
-
-
- private function msg_subscript_journal($journal_stage_id,$journal_id){
- $articles = $this->article_obj->where('journal_stage_id',$journal_stage_id)->where('state',0)->select();
+
+
+ private function msg_subscript_journal($journal_stage_id, $journal_id)
+ {
+ $articles = $this->article_obj->where('journal_stage_id', $journal_stage_id)->where('state', 0)->select();
$stage_info = $this->journal_stage_obj->where('journal_stage_id', $journal_stage_id)->find();
- $journal_info = $this->journal_obj->where('journal_id',$journal_id)->find();
- $list = $this->subscribe_journal_obj->where('journal_id',$journal_id)->where('state',0)->select();
+ $journal_info = $this->journal_obj->where('journal_id', $journal_id)->find();
+ $list = $this->subscribe_journal_obj->where('journal_id', $journal_id)->where('state', 0)->select();
//组成文章信息
$tt1 = '
';
- $tt1 .= $journal_info['title'].'
';
+ $tt1 .= $journal_info['title'] . '
';
$tt1 .= 'Dear Researcher,
';
- $tt1 .= 'It is our great honor to present you the articles published in '.$journal_info['title'].'.
';
+ $tt1 .= 'It is our great honor to present you the articles published in ' . $journal_info['title'] . '.
';
$tt1 .= 'The following new articles have just been published.
';
- foreach ($articles as $val){
- $tt1 .= $val['type'].'
';
- $tt1 .= '
'.$val['title'].'';
- $tt1 .= $this->getAuthor($val).'
';
- $tt1 .= $journal_info['title'].' '.$stage_info['stage_year'].' '.$stage_info['stage_vol']."(".$stage_info['stage_no']."). DOI:".$val['doi'].'
';
- $tt1 .= '
Download pdf';
+ foreach ($articles as $val) {
+ $tt1 .= $val['type'] . '
';
+ $tt1 .= '
' . $val['title'] . '';
+ $tt1 .= $this->getAuthor($val) . '
';
+ $tt1 .= $journal_info['title'] . ' ' . $stage_info['stage_year'] . ' ' . $stage_info['stage_vol'] . "(" . $stage_info['stage_no'] . "). DOI:" . $val['doi'] . '
';
+ $tt1 .= '
Download pdf';
}
- $tt2 = 'Email: '.$journal_info['email'].'
';
- $tt2 .= 'Website: https://www.tmrjournals.com/'.$journal_info['usx'].'
';
+ $tt2 = 'Email: ' . $journal_info['email'] . '
';
+ $tt2 .= 'Website: https://www.tmrjournals.com/' . $journal_info['usx'] . '
';
$tt2 .= 'TMR Publishing Group Ltd.
';
$tt2 .= 'Auckland, New Zealand
';
$tt2 .= 'Tel: +64 02108293806.';
$tt2 .= '
';
- foreach ($list as $v){
- $cache = $tt1.'Unsubscribe
'.$tt2;
+ foreach ($list as $v) {
+ $cache = $tt1 . 'Unsubscribe
' . $tt2;
$maidata['email'] = $v['email'];
$maidata['title'] = $journal_info['title'];
$maidata['content'] = $cache;
$maidata['tmail'] = 'publicrelations@tmrjournals.com';
$maidata['tpassword'] = 'pRWU999999';
-// sendEmail($maidata['email'],$maidata['title'],$maidata['title'],$maidata['content'],$maidata['tmail'],$maidata['tpassword']);
+ // sendEmail($maidata['email'],$maidata['title'],$maidata['title'],$maidata['content'],$maidata['tmail'],$maidata['tpassword']);
Queue::push('app\api\job\mail@fire', $maidata, "mail");
echo $v['email'];
}
}
- private function getAuthor($article) {
+ private function getAuthor($article)
+ {
$where['article_id'] = $article['article_id'];
$where['state'] = 0;
$list = $this->article_author_obj->where($where)->select();
@@ -1332,15 +1480,16 @@ class Journal extends Controller {
return $frag;
}
// 出刊给作者发送邮件
- private function sendAuthor($journal_stage_id,$journal_id){
+ private function sendAuthor($journal_stage_id, $journal_id)
+ {
$stage_info = $this->journal_stage_obj->where('journal_stage_id', $journal_stage_id)->find();
- $journal_info = $this->journal_obj->where('journal_id',$journal_id)->find();
+ $journal_info = $this->journal_obj->where('journal_id', $journal_id)->find();
// 根据journal_stage_id 去article 中 找article_id
- $articles = $this->article_obj->where('journal_stage_id',$journal_stage_id)->where('state',0)->select();
- foreach ($articles as $v){
+ $articles = $this->article_obj->where('journal_stage_id', $journal_stage_id)->where('state', 0)->select();
+ foreach ($articles as $v) {
// 根据article_id 去article_author 中author
- $datas = $this->article_author_obj->where(['article_id'=>$v['article_id'],'email'=>array('neq','')])->select();
- foreach ($datas as $data){
+ $datas = $this->article_author_obj->where(['article_id' => $v['article_id'], 'email' => array('neq', '')])->select();
+ foreach ($datas as $data) {
// 邮件内容
$content = '
'.$v['title'].'
';
- $content .= $this->getAuthor($v).'
';
- $content .= $journal_info['title'].' '.$stage_info['stage_year'].' '.$stage_info['stage_vol']."(".$stage_info['stage_no']."). DOI:".$v['doi'].'
';
- $content .= '
Download pdf';
+ $content .= $v['type'] . '
';
+ $content .= '
' . $v['title'] . '';
+ $content .= $this->getAuthor($v) . '
';
+ $content .= $journal_info['title'] . ' ' . $stage_info['stage_year'] . ' ' . $stage_info['stage_vol'] . "(" . $stage_info['stage_no'] . "). DOI:" . $v['doi'] . '
';
+ $content .= '
Download pdf';
$content .= 'If you want to be sure your research gets the attention it deserves, the following channels may be useful.
';
$content .= 'https://www.researchgate.net
https://www.academia.edu
https://twitter.com
https://www.linkedin.com
https://www.facebook.com
We look forward to receiving manuscripts from you in future.';
$content .= '
';
- $maidata=[
- 'email'=>$data['email'],
- 'title'=>'Congratulations on your published article',
- 'content'=>$content,
- 'tmail'=>'publicrelations@tmrjournals.com',
- 'tpassword'=>'pRWU999999'
+ $maidata = [
+ 'email' => $data['email'],
+ 'title' => 'Congratulations on your published article',
+ 'content' => $content,
+ 'tmail' => 'publicrelations@tmrjournals.com',
+ 'tpassword' => 'pRWU999999'
];
Queue::push('app\api\job\mail@fire', $maidata, "mail");
-
}
-
}
-
-
}
/**
* @title 增加期刊消息
@@ -1397,20 +1542,21 @@ class Journal extends Controller {
* @param name:ctime type:string require:1 desc:时间
*
*/
- public function addNotices(){
+ public function addNotices()
+ {
$data = $this->request->post();
$insert['journal_id'] = $data['journal_id'];
$insert['title'] = $data['title'];
$insert['content'] = $data['content'];
- $insert['ctime'] = $data['ctime']==''?time():strtotime($data['ctime']);
+ $insert['ctime'] = $data['ctime'] == '' ? time() : strtotime($data['ctime']);
$res = $this->journal_notices_obj->insert($insert);
- if($res){
- return json(['code'=>0,'msg'=>'success']);
- }else{
- return json(['code'=>1,'msg'=>'system error']);
+ if ($res) {
+ return json(['code' => 0, 'msg' => 'success']);
+ } else {
+ return json(['code' => 1, 'msg' => 'system error']);
}
}
-
+
/**
* @title 删除期刊消息
* @description 删除期刊消息
@@ -1420,12 +1566,13 @@ class Journal extends Controller {
*
* @param name:journal_notices_id type:int require:1 desc:期刊id
*/
- public function delNotices(){
+ public function delNotices()
+ {
$data = $this->request->post();
- $this->journal_notices_obj->where('journal_notices_id',$data['journal_notices_id'])->update(['state'=>1]);
- return json(['code'=>0,'msg'=>'success']);
+ $this->journal_notices_obj->where('journal_notices_id', $data['journal_notices_id'])->update(['state' => 1]);
+ return json(['code' => 0, 'msg' => 'success']);
}
-
+
/**
* @title 更改期刊消息
* @description 更改期刊消息
@@ -1438,15 +1585,16 @@ class Journal extends Controller {
* @param name:content type:string require:1 desc:内容
* @param name:ctime type:string require:1 desc:时间
*/
- public function changeNotices(){
+ public function changeNotices()
+ {
$data = $this->request->post();
$update['title'] = $data['title'];
$update['content'] = $data['content'];
$update['ctime'] = strtotime($data['ctime']);
- $this->journal_notices_obj->where('journal_notices_id',$data['journal_notices_id'])->update($update);
- return json(['code'=>0,'msg'=>'success']);
+ $this->journal_notices_obj->where('journal_notices_id', $data['journal_notices_id'])->update($update);
+ return json(['code' => 0, 'msg' => 'success']);
}
-
+
/**
* @title 获取期刊消息
* @description 获取期刊消息
@@ -1459,13 +1607,14 @@ class Journal extends Controller {
* @return notices:消息list
* @return journal_info:期刊消息
*/
- public function getNotices(){
+ 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(['journal_info'=>$journal_info,'notices'=>$list]);
+ $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(['journal_info' => $journal_info, 'notices' => $list]);
}
-
+
/**
* @title 增加期刊收刊文章
* @description 增加期刊收刊文章
@@ -1483,19 +1632,20 @@ class Journal extends Controller {
* @return notices:消息list
* @return journal_info:期刊消息
*/
- public function addJournalCfp(){
+ public function addJournalCfp()
+ {
$data = $this->request->post();
$insert['journal_id'] = $data['journal_id'];
$insert['title'] = trim($data['title']);
$insert['icon'] = $data['icon'];
- $insert['sort'] = isset($data['sort'])?$data['sort']:0;
+ $insert['sort'] = isset($data['sort']) ? $data['sort'] : 0;
$insert['showtime'] = $data['showtime'];
$insert['content'] = $data['content'];
$insert['ctime'] = time();
$this->journal_cfp_obj->insert($insert);
return jsonSuccess([]);
}
-
+
/**
* @title 删除期刊收刊文章
* @description 删除期刊收刊文章
@@ -1506,12 +1656,13 @@ class Journal extends Controller {
* @param name:journal_cfp_id type:int require:1 desc:期刊收刊id
*
*/
- public function delJournalCfp(){
+ public function delJournalCfp()
+ {
$data = $this->request->post();
- $this->journal_cfp_obj->where('journal_cfp_id',$data['journal_cfp_id'])->update(['state'=>1]);
+ $this->journal_cfp_obj->where('journal_cfp_id', $data['journal_cfp_id'])->update(['state' => 1]);
return jsonSuccess([]);
}
-
+
/**
* @title 编辑期刊收刊信息
* @description 编辑期刊收刊信息
@@ -1526,17 +1677,18 @@ class Journal extends Controller {
* @param name:showtime type:string require:1 desc:显示时间
* @param name:content type:string require:1 desc:内容
*/
- public function editJournalCfp(){
+ public function editJournalCfp()
+ {
$data = $this->request->post();
$update['title'] = $data['title'];
$update['icon'] = $data['icon'];
$update['sort'] = $data['sort'];
$update['showtime'] = $data['showtime'];
$update['content'] = $data['content'];
- $this->journal_cfp_obj->where('journal_cfp_id',$data['journal_cfp_id'])->update($update);
+ $this->journal_cfp_obj->where('journal_cfp_id', $data['journal_cfp_id'])->update($update);
return jsonSuccess([]);
}
-
+
/**
* @title 获取期刊收刊列表
* @description 获取期刊收刊列表
@@ -1549,16 +1701,17 @@ class Journal extends Controller {
* @return journal:期刊信息#
* @return cfps:收刊列表#
*/
- public function getJournalCfps(){
+ public function getJournalCfps()
+ {
$data = $this->request->post();
- $journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
- $list = $this->journal_cfp_obj->where('journal_id',$data['journal_id'])->where('state',0)->order('sort desc ,journal_cfp_id asc')->select();
-
+ $journal_info = $this->journal_obj->where('journal_id', $data['journal_id'])->find();
+ $list = $this->journal_cfp_obj->where('journal_id', $data['journal_id'])->where('state', 0)->order('sort desc ,journal_cfp_id asc')->select();
+
$re['cfps'] = $list;
$re['journal'] = $journal_info;
return jsonSuccess($re);
}
-
+
/**
* @title cfp图片上传
* @description cfp图片上传
@@ -1570,18 +1723,19 @@ class Journal extends Controller {
*
* @return upurl:图片地址
*/
- public function up_cfp_file() {
+ 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())]);
+ return json(['code' => 0, 'msg' => 'success', 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
} else {
return json(['code' => 1, 'msg' => $file->getError()]);
}
}
}
-
+
/**
* @title 添加期刊paper
* @description 添加期刊paper
@@ -1593,14 +1747,15 @@ class Journal extends Controller {
* @param name:title type:string require:1 desc:标题
*
*/
- public function addJournalPaper(){
+ 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
@@ -1611,12 +1766,13 @@ class Journal extends Controller {
* @param name:journal_paper_id type:int require:1 desc:期刊paperid
*
*/
- public function delJournalPaper(){
+ public function delJournalPaper()
+ {
$data = $this->request->post();
- $this->journal_paper_obj->where('journal_paper_id',$data['journal_paper_id'])->update(['state'=>1]);
+ $this->journal_paper_obj->where('journal_paper_id', $data['journal_paper_id'])->update(['state' => 1]);
return jsonSuccess([]);
}
-
+
/**
* @title 编辑期刊paper
* @description 编辑期刊paper
@@ -1628,12 +1784,13 @@ class Journal extends Controller {
* @param name:title type:string require:1 desc:标题
*
*/
- public function editJournalPaper(){
+ public function editJournalPaper()
+ {
$data = $this->request->post();
- $this->journal_paper_obj->where('journal_paper_id',$data['journal_paper_id'])->update(['title'=>$data['title']]);
+ $this->journal_paper_obj->where('journal_paper_id', $data['journal_paper_id'])->update(['title' => $data['title']]);
return jsonSuccess([]);
}
-
+
/**
* @title 获取期刊缩略图
* @description 获取期刊缩略图
@@ -1645,14 +1802,15 @@ class Journal extends Controller {
*
* @return icon:图片地址#
*/
- public function getJournalIcon(){
+ public function getJournalIcon()
+ {
$data = $this->request->post();
- $journal_info = $this->journal_obj->where('issn',$data['issn'])->find();
-
+ $journal_info = $this->journal_obj->where('issn', $data['issn'])->find();
+
$re['icon'] = $journal_info['licon'];
return jsonSuccess($re);
}
-
+
/**
* @title 通用话题--获取通用话题列表
* @description 通用话题--获取通用话题列表
@@ -1662,16 +1820,17 @@ class Journal extends Controller {
*
* @return topics:通用话题#
*/
- public function getBaseTopicList(){
- $father = $this->base_topic_obj->where('parent_id',0)->where('state',0)->order('sort desc')->select();
- foreach ($father as $k => $v){
- $cache = $this->base_topic_obj->where('parent_id',$v['base_topic_id'])->where('state',0)->order('sort desc')->select();
+ public function getBaseTopicList()
+ {
+ $father = $this->base_topic_obj->where('parent_id', 0)->where('state', 0)->order('sort desc')->select();
+ foreach ($father as $k => $v) {
+ $cache = $this->base_topic_obj->where('parent_id', $v['base_topic_id'])->where('state', 0)->order('sort desc')->select();
$father[$k]['children'] = $cache;
}
$re['topics'] = $father;
return jsonSuccess($re);
}
-
+
/**
* @title 通用话题--增加通用话题
* @description 通用话题--增加通用话题
@@ -1685,23 +1844,24 @@ class Journal extends Controller {
* @param name:icon type:string require:1 desc:图标
*
*/
- public function addBaseTopic(){
+ public function addBaseTopic()
+ {
$data = $this->request->post();
- $check = $this->base_topic_obj->where('title',$data['title'])->where('state',0)->find();
- if($check != null){
+ $check = $this->base_topic_obj->where('title', $data['title'])->where('state', 0)->find();
+ if ($check != null) {
return jsonError('此话题已存在,话题名不能重复!!');
}
-
+
$insert['title'] = trim($data['title']);
$insert['parent_id'] = $data['parent_id'];
$insert['sort'] = $data['sort'];
$insert['icon'] = $data['icon'];
-
+
$this->base_topic_obj->insert($insert);
-
+
return jsonSuccess([]);
}
-
+
/**
* @title 通用话题--编辑通用话题
* @description 通用话题--编辑通用话题
@@ -1713,17 +1873,18 @@ class Journal extends Controller {
* @param name:title type:string require:1 desc:话题名称标题
* @param name:sort type:int require:1 desc:权重值
*/
- public function editBaseTopic(){
+ public function editBaseTopic()
+ {
$data = $this->request->post();
$update['title'] = trim($data['title']);
$update['sort'] = $data['sort'];
- if(isset($data['icon'])){
+ if (isset($data['icon'])) {
$update['icon'] = $data['icon'];
}
- $this->base_topic_obj->where('base_topic_id',$data['base_topic_id'])->update($update);
+ $this->base_topic_obj->where('base_topic_id', $data['base_topic_id'])->update($update);
return jsonSuccess([]);
}
-
+
/**
* @title 通用话题--删除通用话题
* @description 通用话题--删除通用话题
@@ -1733,12 +1894,13 @@ class Journal extends Controller {
*
* @param name:base_topic_id type:int require:1 desc:通用话题id
*/
- public function delBaseTopic(){
+ public function delBaseTopic()
+ {
$data = $this->request->post();
- $this->base_topic_obj->where('base_topic_id',$data['base_topic_id'])->update(['state'=>1]);
+ $this->base_topic_obj->where('base_topic_id', $data['base_topic_id'])->update(['state' => 1]);
return jsonSuccess([]);
}
-
+
/**
* @title 通用话题--图片上传
* @description 通用话题--图片上传
@@ -1750,18 +1912,19 @@ class Journal extends Controller {
*
* @return upurl:图片地址
*/
- public function baseTopic_up_file() {
+ public function baseTopic_up_file()
+ {
$file = request()->file('baseTopic');
if ($file) {
$info = $file->move(ROOT_PATH . 'public' . DS . 'baseTopic');
if ($info) {
- return json(['code'=>0 , 'msg'=>'success', 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
+ return json(['code' => 0, 'msg' => 'success', 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
} else {
return json(['code' => 1, 'msg' => $file->getError()]);
}
}
}
-
+
/**
* @title 增加期刊paper文章
* @description 增加期刊paper文章
@@ -1776,7 +1939,8 @@ class Journal extends Controller {
* @param name:content type:string require:1 desc:内容
*
*/
- public function addJournalPaperArt(){
+ public function addJournalPaperArt()
+ {
$data = $this->request->post();
$insert['journal_paper_id'] = $data['journal_paper_id'];
$insert['journal_id'] = $data['journal_id'];
@@ -1787,7 +1951,7 @@ class Journal extends Controller {
$this->journal_paper_art_obj->insert($insert);
return jsonSuccess([]);
}
-
+
/**
* @title 删除期刊paper文章
* @description 删除期刊paper文章
@@ -1798,12 +1962,13 @@ class Journal extends Controller {
* @param name:journal_paper_art_id type:int require:1 desc:期刊paperid
*
*/
- public function delJournalPaperArt(){
+ 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]);
+ $this->journal_paper_art_obj->where('journal_paper_art_id', $data['journal_paper_art_id'])->update(['state' => 1]);
return jsonSuccess([]);
}
-
+
/**
* @title 编辑期刊paper文章
* @description 编辑期刊paper文章
@@ -1817,15 +1982,16 @@ class Journal extends Controller {
* @param name:sort type:int require:1 desc:权重
*
*/
- public function editJournalPaperArt(){
+ public function editJournalPaperArt()
+ {
$data = $this->request->post();
$update['title'] = $data['title'];
$update['content'] = $data['content'];
- $update['sort']=$data['sort'];
- $this->journal_paper_art_obj->where('journal_paper_art_id',$data['journal_paper_art_id'])->update($update);
+ $update['sort'] = $data['sort'];
+ $this->journal_paper_art_obj->where('journal_paper_art_id', $data['journal_paper_art_id'])->update($update);
return jsonSuccess([]);
}
-
+
/**
* @title 增加期刊line
* @description 增加期刊line
@@ -1840,7 +2006,8 @@ class Journal extends Controller {
* @param name:intro type:string require:1 desc:简介
* @param name:dist type:int require:1 desc:距离
*/
- public function addJournalLine(){
+ public function addJournalLine()
+ {
$data = $this->request->post();
$insert['journal_id'] = $data['journal_id'];
$insert['title'] = $data['title'];
@@ -1851,7 +2018,7 @@ class Journal extends Controller {
$this->journal_line_obj->insert($insert);
return jsonSuccess([]);
}
-
+
/**
* @title 删除期刊line
* @description 删除期刊line
@@ -1861,12 +2028,13 @@ class Journal extends Controller {
*
* @param name:journal_line_id type:int require:1 desc:期刊时间轴id
*/
- public function delJournalLine(){
+ public function delJournalLine()
+ {
$data = $this->request->post();
- $this->journal_line_obj->where('journal_line_id',$data['journal_line_id'])->update(['state'=>1]);
+ $this->journal_line_obj->where('journal_line_id', $data['journal_line_id'])->update(['state' => 1]);
return jsonSuccess([]);
}
-
+
/**
* @title 编辑期刊line
* @description 编辑期刊line
@@ -1881,17 +2049,18 @@ class Journal extends Controller {
* @param name:intro type:string require:1 desc:简介
* @param name:dist type:int require:1 desc:距离
*/
- public function editJournalLine(){
+ public function editJournalLine()
+ {
$data = $this->request->post();
$update['title'] = $data['title'];
$update['time'] = $data['time'];
$update['img'] = $data['img'];
$update['intro'] = $data['intro'];
$update['dist'] = $data['dist'];
- $this->journal_line_obj->where('journal_line_id',$data['journal_line_id'])->update($update);
+ $this->journal_line_obj->where('journal_line_id', $data['journal_line_id'])->update($update);
return jsonSuccess([]);
}
-
+
/**
* @title 获取期刊lines
* @description 获取期刊lines
@@ -1904,16 +2073,17 @@ class Journal extends Controller {
* @return journal:期刊信息#
* @return lines:array#
*/
- public function getJournalLines(){
+ public function getJournalLines()
+ {
$data = $this->request->post();
- $journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
- $list = $this->journal_line_obj->where('journal_id',$data['journal_id'])->where('state',0)->order('journal_line_id')->select();
-
+ $journal_info = $this->journal_obj->where('journal_id', $data['journal_id'])->find();
+ $list = $this->journal_line_obj->where('journal_id', $data['journal_id'])->where('state', 0)->order('journal_line_id')->select();
+
$re['journal'] = $journal_info;
$re['lines'] = $list;
return jsonSuccess($re);
}
-
+
/**
* @title 增加期刊关联期刊
* @description 增加期刊关联期刊
@@ -1924,19 +2094,20 @@ class Journal extends Controller {
* @param name:journal_id type:int require:1 desc:期刊id
* @param name:relat_id type:int require:1 desc:关联期刊id
*/
- public function addJournalralet(){
+ public function addJournalralet()
+ {
$data = $this->request->post();
- $journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
- $rearr = $journal_info['relate']==''?[]:explode(',',$journal_info['relate']);
- if(count($rearr)>5){
+ $journal_info = $this->journal_obj->where('journal_id', $data['journal_id'])->find();
+ $rearr = $journal_info['relate'] == '' ? [] : explode(',', $journal_info['relate']);
+ if (count($rearr) > 5) {
return jsonError('No more than four');
}
$rearr[] = $data['relat_id'];
-
- $this->journal_obj->where('journal_id',$data['journal_id'])->update(['relate'=> implode(',', $rearr)]);
+
+ $this->journal_obj->where('journal_id', $data['journal_id'])->update(['relate' => implode(',', $rearr)]);
return jsonSuccess([]);
}
-
+
/**
* @title 删除期刊关联期刊
* @description 删除期刊关联期刊
@@ -1947,19 +2118,20 @@ class Journal extends Controller {
* @param name:journal_id type:int require:1 desc:期刊id
* @param name:relat_id type:int require:1 desc:关联期刊id
*/
- public function delJournalralet(){
+ public function delJournalralet()
+ {
$data = $this->request->post();
- $journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
- $rearr = $journal_info['relate']==''?[]:explode(',',$journal_info['relate']);
- foreach ($rearr as $k => $v){
- if($v == $data['relat_id']){
+ $journal_info = $this->journal_obj->where('journal_id', $data['journal_id'])->find();
+ $rearr = $journal_info['relate'] == '' ? [] : explode(',', $journal_info['relate']);
+ foreach ($rearr as $k => $v) {
+ if ($v == $data['relat_id']) {
unset($rearr[$k]);
}
}
- $this->journal_obj->where('journal_id',$data['journal_id'])->update(['relate'=> implode(',', $rearr)]);
+ $this->journal_obj->where('journal_id', $data['journal_id'])->update(['relate' => implode(',', $rearr)]);
return jsonSuccess([]);
}
-
+
/**
* @title 获取期刊关联期刊
* @description 获取期刊关联期刊
@@ -1972,17 +2144,18 @@ class Journal extends Controller {
* @return journal:当前期刊#
* @return journals:期刊array#
*/
- public function getJournalralet(){
+ public function getJournalralet()
+ {
$data = $this->request->post();
- $journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
- $rearr = $journal_info['relate']==''?[]:explode(',',$journal_info['relate']);
- $list = $this->journal_obj->where('journal_id','in',$rearr)->where('state',0)->select();
-
+ $journal_info = $this->journal_obj->where('journal_id', $data['journal_id'])->find();
+ $rearr = $journal_info['relate'] == '' ? [] : explode(',', $journal_info['relate']);
+ $list = $this->journal_obj->where('journal_id', 'in', $rearr)->where('state', 0)->select();
+
$re['journal'] = $journal_info;
$re['journals'] = $list;
return jsonSuccess($re);
}
-
+
/**
* @title 增加期刊line文章
* @description 增加期刊line文章
@@ -1994,14 +2167,15 @@ class Journal extends Controller {
* @param name:article_id type:int require:1 desc:文章id
*
*/
- public function addJournalLineArt(){
+ public function addJournalLineArt()
+ {
$data = $this->request->post();
$insert['journal_line_id'] = $data['journal_line_id'];
$insert['article_id'] = $data['article_id'];
$this->article_to_line_obj->insert($insert);
return jsonSuccess([]);
}
-
+
/**
* @title 删除期刊line文章
* @description 删除期刊line文章
@@ -2012,12 +2186,13 @@ class Journal extends Controller {
* @param name:article_to_line_id type:int require:1 desc:期刊id
*
*/
- public function delJournalLineArt(){
+ public function delJournalLineArt()
+ {
$data = $this->request->post();
- $this->article_to_line_obj->where('article_to_line_id',$data['article_to_line_id'])->update(['state'=>1]);
+ $this->article_to_line_obj->where('article_to_line_id', $data['article_to_line_id'])->update(['state' => 1]);
return jsonSuccess([]);
}
-
+
/**
* @title 获取期刊line文章
* @description 获取期刊line文章
@@ -2032,22 +2207,23 @@ class Journal extends Controller {
* @return articles: 文章列表array#
*
*/
- public function getJournalLineArt(){
+ public function getJournalLineArt()
+ {
$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();
+ $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_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)
- ->select();
-
+ ->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)
+ ->select();
+
$re['journalLine'] = $journal_line_info;
$re['journal'] = $journal_info;
$re['articles'] = $list;
return jsonSuccess($re);
}
-
+
/**
* @title 获取文章排除line
* @description 获取文章排除line
@@ -2064,19 +2240,20 @@ class Journal extends Controller {
* $return count:总数
* @return dataList:array#
*/
- public function getArticleByLine(){
+ public function getArticleByLine()
+ {
$data = $this->request->post();
//排除line
- $ids = $this->article_to_line_obj->where('journal_line_id',$data['journal_line_id'])->where('state',0)->column('article_id');
+ $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)->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();
-
+ $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;
return jsonSuccess($re);
}
-
+
/**
* @title 获取期刊paper
* @description 获取期刊paper
@@ -2089,16 +2266,17 @@ class Journal extends Controller {
* @return paperLists:paperlist#
*
*/
- public function getJournalPapers(){
+ public function getJournalPapers()
+ {
$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();
-
+ $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();
+
$re['journalInfo'] = $journal_info;
$re['paperLists'] = $journalPapers;
return jsonSuccess($re);
}
-
+
/**
* @title 获取期刊paper文章列表
* @description 获取期刊paper文章列表
@@ -2112,11 +2290,12 @@ class Journal extends Controller {
* @return articleLists:paperlist#
*
*/
- public function getJournalPaperArt(){
+ public function getJournalPaperArt()
+ {
$data = $this->request->post();
- $paper_info = $this->journal_paper_obj->where('journal_paper_id',$data['journal_paper_id'])->find();
- $list = $this->journal_paper_art_obj->where('journal_paper_id',$data['journal_paper_id'])->where('state',0)->order('sort')->select();
-
+ $paper_info = $this->journal_paper_obj->where('journal_paper_id', $data['journal_paper_id'])->find();
+ $list = $this->journal_paper_art_obj->where('journal_paper_id', $data['journal_paper_id'])->where('state', 0)->order('sort')->select();
+
$re['paperinfo'] = $paper_info;
$re['articleLists'] = $list;
return jsonSuccess($re);
@@ -2133,12 +2312,13 @@ class Journal extends Controller {
*
* @return url:图片地址
*/
- public function upStageIcon(){
+ public function upStageIcon()
+ {
$file = request()->file('stage_icon');
if ($file) {
$info = $file->move(ROOT_PATH . 'public' . DS . 'journalstage');
if ($info) {
- return json(['code'=>0 , 'msg'=>'success', 'url' => str_replace("\\", "/", 'journalstage/'.$info->getSaveName())]);
+ return json(['code' => 0, 'msg' => 'success', 'url' => str_replace("\\", "/", 'journalstage/' . $info->getSaveName())]);
} else {
return json(['code' => 1, 'msg' => $file->getError()]);
}