20201112
This commit is contained in:
@@ -83,6 +83,11 @@ class Board extends Controller {
|
||||
}
|
||||
$list[$k]['author'] = substr($au, 0, -1);
|
||||
}
|
||||
foreach ($list as $k => $v){
|
||||
if($v['type']){
|
||||
$list[$k]['type'] = translateType($v['type']);
|
||||
}
|
||||
}
|
||||
|
||||
$re['articles'] = $list;
|
||||
return jsonSuccess($re);
|
||||
@@ -111,6 +116,11 @@ class Board extends Controller {
|
||||
}
|
||||
$list[$k]['author'] = substr($au, 0, -1);
|
||||
}
|
||||
foreach ($list as $k => $v){
|
||||
if($v['type']){
|
||||
$list[$k]['type'] = translateType($v['type']);
|
||||
}
|
||||
}
|
||||
|
||||
$re['articles'] = $list;
|
||||
return jsonSuccess($re);
|
||||
@@ -139,6 +149,112 @@ class Board extends Controller {
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 编委导入--获取官网编委
|
||||
* @description 编委导入--获取官网编委
|
||||
* @author wangjinlei
|
||||
* @url /api/Board/getOffwebBoard
|
||||
* @method POST
|
||||
*
|
||||
* @param name:journal_id type:int require:1 desc:期刊id
|
||||
*
|
||||
* @return boards:编委list#
|
||||
*/
|
||||
public function getOffwebBoard(){
|
||||
$data = $this->request->post();
|
||||
$journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
|
||||
$cs['issn'] = $journal_info['issn'];
|
||||
$url = 'http://journalapi.tmrjournals.com/public/index.php/api/Main/getBoards';
|
||||
$list = object_to_array(json_decode(myPost($url, $cs)));
|
||||
|
||||
foreach ($list as $k => $v){
|
||||
if($v['tuser_id']==0){
|
||||
continue;
|
||||
}
|
||||
$list[$k]['user'] = $this->user_obj->where('user_id',$v['tuser_id'])->find();
|
||||
}
|
||||
$re['boards'] = $list;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 编委导入--关联用户
|
||||
* @description 编委导入--关联用户
|
||||
* @author wangjinlei
|
||||
* @url /api/Board/relationUser
|
||||
* @method POST
|
||||
*
|
||||
* @param name:user_id type:int require:1 desc:用户id
|
||||
* @param name:journal_id type:int require:1 desc:期刊id
|
||||
* @param name:jboard_id type:int require:1 desc:官网boardid
|
||||
*
|
||||
* @return boards:编委list#
|
||||
*/
|
||||
public function relationUser(){
|
||||
$data = $this->request->post();
|
||||
$url = 'http://journalapi.tmrjournals.com/public/index.php/api/Main/bindBoard';
|
||||
$cs['user_id'] = $data['user_id'];
|
||||
$cs['board_id'] = $data['jboard_id'];
|
||||
$list = myPost($url, $cs);
|
||||
$insert['user_id'] = $data['user_id'];
|
||||
$insert['journal_id'] = $data['journal_id'];
|
||||
$this->board_to_journal_obj->insert($insert);
|
||||
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 编委导入--获取全部审稿人
|
||||
* @description 编委导入--获取全部审稿人
|
||||
* @author wangjinlei
|
||||
* @url /api/Board/getAllReviewer
|
||||
* @method POST
|
||||
*
|
||||
* @return boards:编委list#
|
||||
*/
|
||||
public function getAllReviewer(){
|
||||
$revs = $this->user_obj->where('is_reviewer',1)->where('state',0)->select();
|
||||
$re['reviewers'] = $revs;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 编委导入--通过账号搜索用户
|
||||
* @description 编委导入--通过账号搜索用户
|
||||
* @author wangjinlei
|
||||
* @url /api/Board/searchUserByAccount
|
||||
* @method POST
|
||||
*
|
||||
* @param name:account type:string require:1 desc:用户名
|
||||
*
|
||||
* @return users:用户#
|
||||
*/
|
||||
public function searchUserByAccount(){
|
||||
$data = $this->request->post();
|
||||
$users = $this->user_obj->where('state',0)->where('account','like','%'.$data['account'].'%')->select();
|
||||
$re['users'] = $users;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 编委导入--通过邮箱搜索用户
|
||||
* @description 编委导入--通过邮箱搜索用户
|
||||
* @author wangjinlei
|
||||
* @url /api/Board/searchUserByEmail
|
||||
* @method POST
|
||||
*
|
||||
* @param name:email type:string require:1 desc:邮箱
|
||||
*
|
||||
* @return user:用户信息#
|
||||
*/
|
||||
public function searchUserByEmail(){
|
||||
$data = $this->request->post();
|
||||
$user = $this->user_obj->where('state',0)->where('email',$data['email'])->find();
|
||||
if($user == null){
|
||||
return jsonError('can not find user!!');
|
||||
}
|
||||
$re['user'] = $user;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user