1
This commit is contained in:
@@ -4,6 +4,8 @@ namespace app\api\controller;
|
|||||||
|
|
||||||
use think\Controller;
|
use think\Controller;
|
||||||
use think\Db;
|
use think\Db;
|
||||||
|
use think\Validate;
|
||||||
|
use app\api\controller\User as usercontroller;
|
||||||
use think\Queue;
|
use think\Queue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -26,6 +28,7 @@ class Journal extends Controller {
|
|||||||
protected $user_reviewer_info_obj = '';
|
protected $user_reviewer_info_obj = '';
|
||||||
protected $user_reviewer_obj = '';
|
protected $user_reviewer_obj = '';
|
||||||
protected $user_msg_obj = '';
|
protected $user_msg_obj = '';
|
||||||
|
protected $user_to_special_obj = '';
|
||||||
|
|
||||||
public function __construct(\think\Request $request = null) {
|
public function __construct(\think\Request $request = null) {
|
||||||
parent::__construct($request);
|
parent::__construct($request);
|
||||||
@@ -43,6 +46,7 @@ class Journal extends Controller {
|
|||||||
$this->article_msg_obj = Db::name('article_msg');
|
$this->article_msg_obj = Db::name('article_msg');
|
||||||
$this->article_author_obj = Db::name('article_author');
|
$this->article_author_obj = Db::name('article_author');
|
||||||
$this->country_obj = Db::name('country');
|
$this->country_obj = Db::name('country');
|
||||||
|
$this->user_to_special_obj = Db::name('user_to_special');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -92,4 +96,37 @@ class Journal extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取可申请审稿人的期刊
|
||||||
|
*/
|
||||||
|
public function getJournalsForReviewerInEditor(){
|
||||||
|
$data = $this->request->post();
|
||||||
|
$rule = new Validate([
|
||||||
|
'account' => 'require',
|
||||||
|
'reviewer_id' => 'require'
|
||||||
|
]);
|
||||||
|
if(!$rule->check($data)){
|
||||||
|
return jsonError($rule->getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
$editor_info = $this->user_obj->where('account',$data['account'])->find();
|
||||||
|
$journalIds = [];
|
||||||
|
if($editor_info['type']==2){//责任编辑
|
||||||
|
$journalIds = $this->journal_obj->where('eidtor_id',$editor_info['user_id'])->column('journal_id');
|
||||||
|
}else{//客座编辑
|
||||||
|
$guests = $this->user_to_special_obj->where('user_id',$data['reviewer_id'])->where('uts_state',0)->select();
|
||||||
|
$usercontroller = new usercontroller();
|
||||||
|
foreach($guests as $v){
|
||||||
|
$c_res = $usercontroller->getSpecialDetailById($v['special_id']);
|
||||||
|
$journalIds[] = $this->journal_obj->where('issn',$c_res['journal_issn'])->value('journal_id');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$njournalIds = $this->reviewer_to_journal_obj->where('reviewer_id',$data['user_id'])->where('state',0)->column('journal_id');
|
||||||
|
$list = $this->journal_obj->where('journal_id',"not in",$njournalIds)->where('journal_id',"in",$journalIds)->where('state',0)->select();
|
||||||
|
|
||||||
|
$re['journals'] = $list;
|
||||||
|
return jsonSuccess($re);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ class Special extends Controller {
|
|||||||
'from_name'=>'TMR'
|
'from_name'=>'TMR'
|
||||||
];
|
];
|
||||||
// Queue::push('app\api\job\domail@fire',$sendUser,'domail');
|
// Queue::push('app\api\job\domail@fire',$sendUser,'domail');
|
||||||
sendEmail($email, 'Dear ' . $data['realname'], 'TMR', $content);
|
sendEmail($email, 'Dear ' . $data['realname'], 'TMR', $content);
|
||||||
return json($inser_data);
|
return json($inser_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,7 +167,7 @@ class Special extends Controller {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加文章(作者)
|
* 添加专刊文章(作者)
|
||||||
*/
|
*/
|
||||||
public function addArticle() {
|
public function addArticle() {
|
||||||
//接受参数,查询信息
|
//接受参数,查询信息
|
||||||
|
|||||||
@@ -354,7 +354,7 @@ class User extends Controller
|
|||||||
$specials = [];
|
$specials = [];
|
||||||
foreach($list as $k => $v){
|
foreach($list as $k => $v){
|
||||||
$cache_info = $this->getSpecialDetailById($v['special_id']);
|
$cache_info = $this->getSpecialDetailById($v['special_id']);
|
||||||
$cache_journal = $this->journal_obj->where('issn',$cache_info['journal_issn']);
|
$cache_journal = $this->journal_obj->where('issn',$cache_info['journal_issn'])->find();
|
||||||
$cache_info['journal_id'] = $cache_journal['journal_id'];
|
$cache_info['journal_id'] = $cache_journal['journal_id'];
|
||||||
$specials[] = $cache_info;
|
$specials[] = $cache_info;
|
||||||
}
|
}
|
||||||
@@ -365,8 +365,8 @@ class User extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private function getSpecialDetailById($special_id){
|
public function getSpecialDetailById($special_id){
|
||||||
$base_url = Env::get('base_url');
|
$base_url = Env::get('journal.base_url');
|
||||||
$api_url = $base_url."/master/special/getSpecialDetailById";
|
$api_url = $base_url."/master/special/getSpecialDetailById";
|
||||||
$res = object_to_array(json_decode(myPost($api_url,['journal_special_id'=>$special_id])));
|
$res = object_to_array(json_decode(myPost($api_url,['journal_special_id'=>$special_id])));
|
||||||
$special_info = $res['data']['special'];
|
$special_info = $res['data']['special'];
|
||||||
@@ -390,6 +390,11 @@ class User extends Controller
|
|||||||
if(!isset($data['special_id'])){
|
if(!isset($data['special_id'])){
|
||||||
return jsonError("添加客座编辑身份时,客座id是必传项");
|
return jsonError("添加客座编辑身份时,客座id是必传项");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$check = $this->user_to_special_obj->where("user_id",$data['user_id'])->where('special_id',$data['special_id'])->where('uts_state',0)->find();
|
||||||
|
if($check){
|
||||||
|
return jsonError("不可重复添加");
|
||||||
|
}
|
||||||
$insert_uts['user_id'] = $data['user_id'];
|
$insert_uts['user_id'] = $data['user_id'];
|
||||||
$insert_uts['special_id'] = $data['special_id'];
|
$insert_uts['special_id'] = $data['special_id'];
|
||||||
$insert_uts['uts_ctime'] = time();
|
$insert_uts['uts_ctime'] = time();
|
||||||
|
|||||||
Reference in New Issue
Block a user