1
This commit is contained in:
@@ -948,7 +948,7 @@ class Article extends Controller
|
||||
|
||||
//初审分数不够,自动拒稿
|
||||
if ($article_info['state'] == 0 && $article_info['type'] != 'N' && $article_info['type'] != 'T') {
|
||||
if (($journal_info['journal_id'] == 1 && $article_info['scoring'] < 4) || (($journal_info['journal_id'] == 10 || $journal_info['journal_id'] == 23) && $article_info['scoring'] < 3) || ($journal_info['journal_id'] == 16 && $article_info['scoring'] < 2) || ($journal_info['journal_id'] != 1 && $journal_info['journal_id'] != 10 && $journal_info['journal_id'] != 23 && $article_info['scoring'] < 1.5)) {
|
||||
if (($journal_info['journal_id'] == 1 && $article_info['scoring'] < 4) || (($journal_info['journal_id'] == 10 || $journal_info['journal_id'] == 23) && $article_info['scoring'] < 3) || ($journal_info['journal_id'] == 21 && $article_info['scoring'] < 1) || ($journal_info['journal_id'] == 16 && $article_info['scoring'] < 2) || ($journal_info['journal_id'] != 1 && $journal_info['journal_id'] != 10 && $journal_info['journal_id'] != 21 && $journal_info['journal_id'] != 23 && $article_info['scoring'] < 1.5)) {
|
||||
if (count($transfer_list) > 0) {
|
||||
//查询转投期刊信息
|
||||
$transfer_journal = $this->journal_obj->where('journal_id', $transfer_list[0]['journal_id'])->find();
|
||||
@@ -1498,6 +1498,11 @@ class Article extends Controller
|
||||
$reviewer_move = $this->user_reviewer_info_obj->where("reviewer_info_id", $reviewer_info['user_id'])->find();
|
||||
// $journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find();
|
||||
|
||||
$check = $this->article_reviewer_obj->where('reviewer_id',$data['uid'])->where('article_id',$data['articleId'])->find();
|
||||
if($check){
|
||||
return jsonError("Invitation record already exists!");
|
||||
}
|
||||
|
||||
//增加信息到文章审稿表
|
||||
$insert_data['reviewer_id'] = $data['uid'];
|
||||
$insert_data['article_id'] = $data['articleId'];
|
||||
@@ -2081,7 +2086,7 @@ class Article extends Controller
|
||||
|
||||
$author_email = [];
|
||||
|
||||
$authors = $this->article_author_obj->where('article_id', $data['article_id'])->select();
|
||||
$authors = $this->article_author_obj->where('article_id', $data['article_id'])->where('state',0)->select();
|
||||
foreach ($authors as $k => $v) {
|
||||
$cache['email'] = trim($v['email']);
|
||||
$cache['name'] = trim($v['firstname']) . ' ' . trim($v['lastname']);
|
||||
|
||||
@@ -17,6 +17,7 @@ class Auto extends Controller {
|
||||
protected $article_obj = '';
|
||||
protected $article_reviewer_obj = '';
|
||||
protected $user_obj = '';
|
||||
protected $user_reviewer_info_obj = '';
|
||||
protected $rev_to_jour_obj = '';
|
||||
protected $reviewer_obj = '';
|
||||
protected $journal_obj = '';
|
||||
@@ -24,12 +25,14 @@ class Auto extends Controller {
|
||||
protected $article_msg_obj = '';
|
||||
protected $user_log_obj = '';
|
||||
protected $reviewer_info_obj = '';
|
||||
protected $user_cv_obj = '';
|
||||
|
||||
public function __construct(\think\Request $request = null) {
|
||||
parent::__construct($request);
|
||||
$this->article_obj = Db::name('article');
|
||||
$this->article_reviewer_obj = Db::name('article_reviewer');
|
||||
$this->user_obj = Db::name('user');
|
||||
$this->user_reviewer_info_obj = Db::name('user_reviewer_info');
|
||||
$this->login_auto_obj = Db::name('login_auto');
|
||||
$this->rev_to_jour_obj = Db::name('reviewer_to_journal');
|
||||
$this->journal_obj = Db::name('journal');
|
||||
@@ -37,6 +40,7 @@ class Auto extends Controller {
|
||||
$this->article_msg_obj = Db::name('article_msg');
|
||||
$this->user_log_obj = Db::name('user_log');
|
||||
$this->reviewer_info_obj = Db::name('user_reviewer_info');
|
||||
$this->user_cv_obj = Db::name('user_cv');
|
||||
}
|
||||
|
||||
public function phpinfo(){
|
||||
@@ -146,6 +150,34 @@ class Auto extends Controller {
|
||||
}
|
||||
|
||||
|
||||
// public function cvComit(){
|
||||
// $list = $this->user_reviewer_info_obj
|
||||
// ->field('t_user.user_id,t_user.ctime,t_user_reviewer_info.qualifications')
|
||||
// ->join("t_user","t_user.user_id = t_user_reviewer_info.reviewer_id",'left')
|
||||
// ->where('t_user_reviewer_info.qualifications','<>','')
|
||||
// ->select();
|
||||
// foreach($list as $v){
|
||||
// $check = $this->user_cv_obj->where('cv',$v['qualifications'])->find();
|
||||
// if(!$v['user_id']||$check){
|
||||
// continue;
|
||||
// }
|
||||
// $insert['user_id'] = $v['user_id'];
|
||||
// $insert['cv'] = $v['qualifications'];
|
||||
// $insert['ctime'] = $v['ctime'];
|
||||
// $this->user_cv_obj->insert($insert);
|
||||
// }
|
||||
// dump($list);
|
||||
// }
|
||||
|
||||
public function getUserqqqq(){
|
||||
$num = $this->request->post('num');
|
||||
$limit_start = ($num - 1) * 1000;
|
||||
$users = $this->user_obj->join("t_user_reviewer_info",'t_user_reviewer_info.reviewer_id = t_user.user_id','left')->limit($limit_start,1000)->select();
|
||||
$re['list'] = $users;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
|
||||
public function qqqq(){
|
||||
$extension_obj = Db::name('exten');
|
||||
$data = $this->request->post();
|
||||
|
||||
@@ -17,6 +17,9 @@ class Ucenter extends Controller{
|
||||
protected $article_obj = '';
|
||||
protected $chief_to_journal_obj = '';
|
||||
protected $board_to_journal_obj = '';
|
||||
protected $major_obj = "";
|
||||
protected $major_to_journal_obj = '';
|
||||
protected $user_cv_obj = '';
|
||||
|
||||
public function __construct(\think\Request $request = null)
|
||||
{
|
||||
@@ -29,7 +32,9 @@ class Ucenter extends Controller{
|
||||
$this->article_obj = Db::name('article');
|
||||
$this->chief_to_journal_obj = Db::name('chief_to_journal');
|
||||
$this->board_to_journal_obj = Db::name('board_to_journal');
|
||||
|
||||
$this->major_obj = Db::name("major");
|
||||
$this->major_to_journal_obj = Db::name('major_to_journal');
|
||||
$this->user_cv_obj = Db::name('user_cv');
|
||||
}
|
||||
|
||||
|
||||
@@ -44,19 +49,33 @@ class Ucenter extends Controller{
|
||||
public function getUserInfo(){
|
||||
//接收参数
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
'user_id'=>'require'
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
|
||||
if(!isset($data['account'])){
|
||||
return json(['code' => 1,'msg'=>'account not null']);
|
||||
}
|
||||
//账号是否存在
|
||||
$isExist = $this->user_obj->where(['account' => $data['account']])->find();
|
||||
if(!$isExist){
|
||||
return json(['code' => 1,'msg'=>'account not exist']);
|
||||
}
|
||||
// 基本信息
|
||||
$baseInfo = $this->user_obj->where(['account' => $data['account']])->field('user_id,account,realname,email,ctime,orcid,icon,type')->find();
|
||||
$userInfo['baseInfo'] = $baseInfo;
|
||||
$baseInfo = $this->user_obj->where(['user_id' => $data['user_id']])->find();
|
||||
// $userInfo['baseInfo'] = $baseInfo;
|
||||
|
||||
//检查用户reviewer的info信息
|
||||
$reviewer_info = $this->user_reviewer_info_obj->where('reviewer_id',$data['user_id'])->find();
|
||||
if(!$reviewer_info){
|
||||
$insert_reviewer['reviewer_id'] = $data['user_id'];
|
||||
$this->user_reviewer_info_obj->insert($insert_reviewer);
|
||||
}
|
||||
|
||||
$userInfo['baseInfo']=$this->user_obj
|
||||
// ->field("t_user.*,")
|
||||
->join('t_user_reviewer_info','t_user.user_id = t_user_reviewer_info.reviewer_id','left')
|
||||
->where('t_user.user_id',$data['user_id'])
|
||||
->find();
|
||||
|
||||
//cv信息
|
||||
$cvs = $this->user_cv_obj->where('user_id',$data['user_id'])->where('state',0)->select();
|
||||
$userInfo['cvs'] = $cvs;
|
||||
// 默认为作者(若作者没有发表过文章则不返回)
|
||||
$isAuthor = $this->article_obj->where(['user_id'=>$baseInfo['user_id']])->find();
|
||||
if($isAuthor){
|
||||
@@ -67,32 +86,49 @@ class Ucenter extends Controller{
|
||||
if($isReviewer){
|
||||
$userInfo['asReviewer'] = self::getAsReviewer($baseInfo['user_id']);
|
||||
}
|
||||
|
||||
// 编辑
|
||||
if($baseInfo['type'] == 2){
|
||||
$editor = self::getAsEditor($baseInfo['user_id']);
|
||||
if(!empty($editor)){
|
||||
$userInfo['asEditor'] = $editor;
|
||||
}
|
||||
//编委信息
|
||||
$isBoard = $this->board_to_journal_obj->where('user_id',$baseInfo['user_id'])->where('state',0)->select();
|
||||
if($isBoard){
|
||||
$userInfo['asBoard'] = self::getAsBoard($baseInfo['user_id']);
|
||||
}
|
||||
// 主编
|
||||
$isChief = $this->chief_to_journal_obj->where(['user_id'=>$baseInfo['user_id'],'state'=>0])->find();
|
||||
if(!empty($isChief)){
|
||||
$userInfo['asChief'] = self::getAsChief($baseInfo['user_id']);
|
||||
}
|
||||
|
||||
// 编委
|
||||
// $isBoard = $this->board_to_journal_obj->where(['user_id'=>$baseInfo['user_id'],'state'=>0])->select();
|
||||
// if(!empty($isBoard)){
|
||||
// $userInfo['asBoard'] = self::getAsBoard($isBoard);
|
||||
// }
|
||||
// 客座编辑 asGuestEditor
|
||||
|
||||
// 青年编委 asYBoard
|
||||
|
||||
return jsonSuccess($userInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加用户cv
|
||||
*/
|
||||
public function addUserCv(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
'user_id'=>'require',
|
||||
'cv'=>'require'
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$insert['user_id'] = $data['user_id'];
|
||||
$insert['cv'] = $data['cv'];
|
||||
$insert['ctime'] = time();
|
||||
$this->user_cv_obj->insert($insert);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户简历
|
||||
*/
|
||||
public function delUserCv(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
'user_cv_id'=>'require'
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$this->user_cv_obj->where('user_cv_id',$data['user_cv_id'])->update(['state'=>1]);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 修改个人基本信息baseInfo
|
||||
* User: wangzhaocui
|
||||
@@ -102,23 +138,30 @@ class Ucenter extends Controller{
|
||||
*/
|
||||
public function updateUserInfo(){
|
||||
$data = $this->request->post();
|
||||
if(!isset($data['account']) || !isset($data['realname']) || !isset($data['email'])){
|
||||
return json(['code' => 1,'msg'=>'account not null']);
|
||||
$rule = new Validate([
|
||||
'user_id'=>'require',
|
||||
'realname'=>'require',
|
||||
'technical'=>'require',
|
||||
'country'=>'require',
|
||||
'major'=>'require|number',
|
||||
'field'=>'require'
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
//验证邮箱是否合规
|
||||
if(!preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/",$data['email'])){
|
||||
return json(['code'=>1,'msg'=>'Invalid email']);
|
||||
$update['realname'] = trim($data['realname']);
|
||||
if(isset($data['phone'])&&$data['phone']!=''){
|
||||
$update['phone'] = $data['phone'];
|
||||
}
|
||||
// 邮箱是否已经被绑定
|
||||
$res = $this->user_obj->where(['email'=>$data['email']])->find();
|
||||
if($res){
|
||||
return json(['code' => 1,'msg'=>'email is exist']);
|
||||
}
|
||||
$update=[
|
||||
'realname'=>$data['realname'],
|
||||
'email'=>$data['email']
|
||||
$this->user_obj->where(['user_id'=>$data['user_id']])->update($update);
|
||||
$updata1=[
|
||||
'technical'=>$data['technical'],
|
||||
'country'=>$data['country'],
|
||||
'major'=>$data['major'],
|
||||
'field'=>$data['field'],
|
||||
'introduction'=>$data['introduction'],
|
||||
];
|
||||
$this->user_obj->where(['account'=>$data['account']])->update($update);
|
||||
$this->user_reviewer_info_obj->where(['reviewer_id'=>$data['user_id']])->update($updata1);
|
||||
return jsonSuccess([]);
|
||||
|
||||
}
|
||||
@@ -130,30 +173,29 @@ class Ucenter extends Controller{
|
||||
* Time: 17:02
|
||||
* @return \think\response\Json
|
||||
*/
|
||||
public function updateAsReviewerInfo(){
|
||||
$data = $this->request->post();
|
||||
// 验证规则
|
||||
$rule = new Validate([
|
||||
'user_id'=>'require|number',
|
||||
'technical'=>'require',
|
||||
'country'=>'require',
|
||||
'major'=>'require|number',
|
||||
'field'=>'require',
|
||||
// 'introduction'=>'require'
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return json(['code' => 1,'msg'=>$rule->getError()]);
|
||||
}
|
||||
$updata=[
|
||||
'technical'=>$data['technical'],
|
||||
'country'=>$data['country'],
|
||||
'major'=>$data['major'],
|
||||
'field'=>$data['field'],
|
||||
'introduction'=>$data['introduction'],
|
||||
];
|
||||
$this->user_reviewer_info_obj->where(['reviewer_id'=>$data['user_id']])->update($updata);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
// public function updateAsReviewerInfo(){
|
||||
// $data = $this->request->post();
|
||||
// // 验证规则
|
||||
// $rule = new Validate([
|
||||
// 'user_id'=>'require|number',
|
||||
// 'technical'=>'require',
|
||||
// 'country'=>'require',
|
||||
// 'major'=>'require|number',
|
||||
// 'field'=>'require'
|
||||
// ]);
|
||||
// if(!$rule->check($data)){
|
||||
// return json(['code' => 1,'msg'=>$rule->getError()]);
|
||||
// }
|
||||
// $updata=[
|
||||
// 'technical'=>$data['technical'],
|
||||
// 'country'=>$data['country'],
|
||||
// 'major'=>$data['major'],
|
||||
// 'field'=>$data['field'],
|
||||
// 'introduction'=>$data['introduction'],
|
||||
// ];
|
||||
// $this->user_reviewer_info_obj->where(['reviewer_id'=>$data['user_id']])->update($updata);
|
||||
// return jsonSuccess([]);
|
||||
// }
|
||||
|
||||
/**
|
||||
* Notes:修改 asEditor 信息
|
||||
@@ -195,31 +237,30 @@ class Ucenter extends Controller{
|
||||
*/
|
||||
public function updateIncon(){
|
||||
// 获取表单上传文件
|
||||
$file = request()->file('icon');
|
||||
$data = $this->request->post();
|
||||
if(!$file){
|
||||
return json(['code'=>1,'msg'=>'icon not null']);
|
||||
$rule = new Validate([
|
||||
'user_id'=>'require',
|
||||
'icon'=>'require'
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
if(!isset($data['account']) || empty($data['account'])){
|
||||
return json(['code'=>1,'msg'=>'account not null']);
|
||||
}
|
||||
// 移动到框架应用根目录/public/icon/ 目录下
|
||||
if($file){
|
||||
$info = $file->move(ROOT_PATH . 'public' . DS . 'icon');
|
||||
if($info){
|
||||
// 输出 icon/20160820/42a79759f284b767dfcb2a0197904287.jpg
|
||||
$icon = 'icon/'.str_replace("\\", "/", $info->getSaveName());
|
||||
// 更新数据库
|
||||
$this->user_obj->where(['account'=>$data['account']])->update(['icon'=>$icon]);
|
||||
return jsonSuccess(['account'=>$data['account'],'icon'=>$icon]);
|
||||
}else{
|
||||
// 上传失败获取错误信息
|
||||
return json(['code'=>1,'msg'=>$file->getError()]);
|
||||
$this->user_obj->where(['user_id'=>$data['user_id']])->update(['icon'=>$data['icon']]);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
public function up_userIcon_file()
|
||||
{
|
||||
$file = request()->file('icon');
|
||||
if ($file) {
|
||||
$info = $file->move(ROOT_PATH . 'public' . DS . 'usericon');
|
||||
if ($info) {
|
||||
return json(['code' => 0, 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
|
||||
} else {
|
||||
return json(['code' => 1, 'msg' => $file->getError()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 作者信息
|
||||
* User: wangzhaocui
|
||||
@@ -246,6 +287,19 @@ class Ucenter extends Controller{
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function getMajor(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
'major_id'=>'require'
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$major = $this->major_obj->where('major_id',$data['major_id'])->find();
|
||||
$major['children'] = $this->major_obj->where('pid',$major['major_id'])->select();
|
||||
$re['major'] = $major;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
/**
|
||||
* Notes:获取审稿人
|
||||
* User: admin
|
||||
@@ -255,7 +309,10 @@ class Ucenter extends Controller{
|
||||
*/
|
||||
private function getAsReviewer($userId){
|
||||
// 获取审稿人基本信息
|
||||
$res = $this->user_reviewer_info_obj->field('gender,technical,country,major,field,introduction')->where(['reviewer_id'=>$userId])->find();
|
||||
$res = $this->user_reviewer_info_obj->where(['reviewer_id'=>$userId])->find();
|
||||
|
||||
$res['majors'] = self::getMajorShu($res['major']);
|
||||
|
||||
|
||||
// 获取审稿人期刊
|
||||
$journal = $this->reviewer_to_journal_obj->field('t_journal.title,t_journal.abbr')
|
||||
@@ -263,16 +320,23 @@ class Ucenter extends Controller{
|
||||
->where(['t_reviewer_to_journal.reviewer_id'=>$userId,'t_reviewer_to_journal.state'=>0])
|
||||
->select();
|
||||
// 审稿人成功审稿次数
|
||||
$reviewerWhere=[
|
||||
'reviewer_id'=>$userId,
|
||||
'state'=>3
|
||||
];
|
||||
$successReview = $this->article_reviewer_obj->where($reviewerWhere)->count();
|
||||
$successReview = $this->article_reviewer_obj->where('reviewer_id',$userId)->where('state','in',[1,2,3])->count();
|
||||
|
||||
$res['successReview'] = $successReview;
|
||||
$res['journal'] = $journal;
|
||||
return $res;
|
||||
}
|
||||
|
||||
private function getMajorShu($major){
|
||||
$res = $this->major_obj->where('major_id',$major)->find();
|
||||
if($res['pid']==1){
|
||||
return $res['major_id'];
|
||||
}
|
||||
|
||||
$p = self::getMajorShu($res['pid']);
|
||||
return $p.','.$res['major_id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 编辑的期刊资料
|
||||
* User: wangzhaocui
|
||||
@@ -319,41 +383,34 @@ class Ucenter extends Controller{
|
||||
* @param $data
|
||||
* @return array
|
||||
*/
|
||||
private function getAsBoard($data){
|
||||
private function getAsBoard($user_id){
|
||||
$data = $this->board_to_journal_obj->where('user_id',$user_id)->where('state',0)->select();
|
||||
foreach ($data as $k=>$v){
|
||||
// 查找期刊title
|
||||
$data[$k]= $this->journal_obj->where('journal_id',$v['journal_id'])->field('journal_id,title,issn,abbr')->find();
|
||||
// $data[$k]= $this->journal_obj->where('journal_id',$v['journal_id'])->field('journal_id,title,issn,abbr')->find();
|
||||
$data[$k]= $this->journal_obj->where('journal_id',$v['journal_id'])->find();
|
||||
// 其他编委名字
|
||||
$otherBoards = $this->board_to_journal_obj->field('t_user.realname')
|
||||
->join('t_user','t_user.user_id = t_board_to_journal.user_id')
|
||||
->where('t_board_to_journal.journal_id',$v['journal_id'])
|
||||
->select();
|
||||
$data[$k]['otherBoards'] = array_column($otherBoards, 'realname');
|
||||
// $otherBoards = $this->board_to_journal_obj->field('t_user.realname')
|
||||
// ->join('t_user','t_user.user_id = t_board_to_journal.user_id')
|
||||
// ->where('t_board_to_journal.journal_id',$v['journal_id'])
|
||||
// ->select();
|
||||
// $data[$k]['otherBoards'] = array_column($otherBoards, 'realname');
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 客座编辑资料(未完成)
|
||||
* User: wangzhaocui
|
||||
* Date: 2022/3/16
|
||||
* Time: 10:22
|
||||
* @param $userId
|
||||
*/
|
||||
private function getAsGuestEditor($userId){
|
||||
return ;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 青年编委
|
||||
* User: wangzhaocui
|
||||
* Date: 2022/3/17
|
||||
* Time: 16:01
|
||||
* @param $userId
|
||||
*/
|
||||
private function getAsYBoard($userId){
|
||||
return ;
|
||||
|
||||
public function up_cv_file()
|
||||
{
|
||||
$file = request()->file('reviewerCV');
|
||||
if ($file) {
|
||||
$info = $file->move(ROOT_PATH . 'public' . DS . 'reviewer');
|
||||
if ($info) {
|
||||
return json(['code' => 0, 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
|
||||
} else {
|
||||
return json(['code' => 1, 'msg' => $file->getError()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ class User extends Controller
|
||||
protected $user_black_obj = '';
|
||||
protected $user_to_special_obj = '';
|
||||
protected $user_register_check_obj = '';
|
||||
protected $user_cert_obj = '';
|
||||
|
||||
public function __construct(\think\Request $request = null)
|
||||
{
|
||||
@@ -56,6 +57,7 @@ class User extends Controller
|
||||
$this->user_black_obj = Db::name('user_black');
|
||||
$this->user_to_special_obj = Db::name('user_to_special');
|
||||
$this->user_register_check_obj = Db::name('user_register_check');
|
||||
$this->user_cert_obj = Db::name('user_cert');
|
||||
}
|
||||
|
||||
public function pstest(){
|
||||
@@ -327,7 +329,9 @@ class User extends Controller
|
||||
$inser_data['phone'] = isset($data['phone']) ? $data['phone'] : '';
|
||||
$inser_data['realname'] = isset($data['realname']) ? $data['realname'] : '';
|
||||
$inser_data['ctime'] = time();
|
||||
$this->user_obj->insertGetId($inser_data);
|
||||
$id = $this->user_obj->insertGetId($inser_data);
|
||||
$insert_reviewer['reviewer_id'] = $id;
|
||||
$this->user_reviewer_info_obj->insert($insert_reviewer);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
@@ -390,11 +394,6 @@ class User extends Controller
|
||||
echo 'Unsubscribe successfully!';
|
||||
}
|
||||
|
||||
|
||||
public function mytestemail(){
|
||||
sendEmail('751475802@qq.com', "test", "test", "hello", "tmr@tmrjournals.com", "849192806Pnx");
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 申请期刊审稿人对于审稿人
|
||||
* @description 申请期刊审稿人对于审稿人
|
||||
@@ -881,6 +880,10 @@ class User extends Controller
|
||||
$inser_data['ctime'] = time();
|
||||
$id = $this->user_obj->insertGetId($inser_data);
|
||||
|
||||
//存入个人额外信息
|
||||
$insert_reviewer['reviewer_id'] = $id;
|
||||
$r_res = $this->user_reviewer_info_obj->insert($insert_reviewer);
|
||||
|
||||
//存储注册验证信息
|
||||
$insert_check['user_id'] = $id;
|
||||
$insert_check['code'] = $code;
|
||||
@@ -894,7 +897,7 @@ class User extends Controller
|
||||
$tt .= "<a href='https://submission.tmrjournals.com/login?code=".$code."'>https://submission.tmrjournals.com/login?code=".$code."</a><br><br>";
|
||||
$tt .= "Thank you.<br>TMR Publishing Group<br>https://www.tmrjournals.com";
|
||||
|
||||
if($id&&$i_res){
|
||||
if($id&&$i_res&&$r_res){
|
||||
Db::commit();
|
||||
sendEmail($email, 'Dear ' . $data['name'], 'TMR', $tt);
|
||||
return jsonSuccess([]);
|
||||
@@ -1662,6 +1665,52 @@ class User extends Controller
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加用户证书
|
||||
*/
|
||||
public function addUserCert(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
'user_id'=>'require',
|
||||
'journal_id'=>'require',
|
||||
'type'=>'require',
|
||||
'year'=>'require'
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$user_info = $this->user_obj->where('user_id',$data['user_id'])->find();
|
||||
$journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
|
||||
$check = $this->user_cert_obj->where('user_id',$data['user_id'])->where('type',$data['type'])->where('journal_id',$data['journal_id'])->where('year',$data['year'])->where('state',0)->find();
|
||||
if($check){
|
||||
return jsonError("Certificate cannot be issued repeatedly");
|
||||
}
|
||||
$this->createCert($user_info,$journal_info,$data['year'],$data['type']);
|
||||
|
||||
$insert['user_id']=$data['user_id'];
|
||||
$insert['journal_id'] = $data['journal_id'];
|
||||
$insert['type'] = $data['type'];
|
||||
$insert['year'] = $data['year'];
|
||||
$insert['url'] = "/cert/".$data['user_id'].'_'.$data['type'].'_'.$data['year'] . '.png';
|
||||
$insert['ctime'] = time();
|
||||
$this->user_cert_obj->insert($insert);
|
||||
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
private function createCert($user_info,$journal_info,$year,$type){
|
||||
$template = ROOT_PATH . 'public' . DS . 'cert' . DS . 'cert_template.png';
|
||||
$ziti = ROOT_PATH . 'public' . DS . 'zhengshu' . DS . 'siyuan.ttf';
|
||||
$image = \think\Image::open($template);
|
||||
|
||||
$image->text($user_info['realname'], $ziti, 50, '#000000', [1060, 760])
|
||||
->text($year, $ziti, 50, '#C49A6C', [1850, 505])
|
||||
->text($year, $ziti, 36, '#C49A6C', [1665, 1052])
|
||||
->text($journal_info['title'], $ziti, 36, '#C49A6C', [920, 980])
|
||||
->save(ROOT_PATH . 'public' . DS . 'cert' . DS . $user_info['user_id'].'_'.$type.'_'.$year . '.png');
|
||||
// return ROOT_PATH . 'public' . DS . 'cert' . DS . $user_info['user_id'] . '.png';
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册绑定orcid至我们的账户
|
||||
*/
|
||||
|
||||
@@ -351,6 +351,10 @@ function my_doiToFrag2($data){
|
||||
$bj = bekjournal($res[2]);
|
||||
$joura = formateJournal(trim($bj[0]));
|
||||
$update['joura'] = $joura;
|
||||
$is_js = 0;
|
||||
if($joura==trim($bj[0])){
|
||||
|
||||
}
|
||||
$update['is_ja'] = $joura==trim($bj[0])?0:1;
|
||||
$update['dateno'] = str_replace(' ','',str_replace('-','–',trim($bj[1])));
|
||||
$update['doilink'] = "http://doi.org/".$data['refer_doi'];
|
||||
|
||||
Reference in New Issue
Block a user