1
This commit is contained in:
@@ -2,49 +2,17 @@
|
|||||||
|
|
||||||
namespace app\api\controller;
|
namespace app\api\controller;
|
||||||
|
|
||||||
use think\Controller;
|
use app\api\controller\Base;
|
||||||
use think\Db;
|
|
||||||
use think\Queue;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 公共管理相关
|
* @title 公共管理相关
|
||||||
* @description 公共管理相关
|
* @description 公共管理相关
|
||||||
*/
|
*/
|
||||||
class Admin extends Controller {
|
class Admin extends Base {
|
||||||
|
|
||||||
protected $user_obj = '';
|
|
||||||
protected $captcha_obj = '';
|
|
||||||
protected $journal_obj = '';
|
|
||||||
protected $user_act_obj = '';
|
|
||||||
protected $reviewer_major_obj = '';
|
|
||||||
protected $article_obj = '';
|
|
||||||
protected $article_msg_obj = '';
|
|
||||||
protected $article_author_obj = '';
|
|
||||||
protected $admin_obj = '';
|
|
||||||
protected $country_obj = '';
|
|
||||||
protected $reviewer_to_journal_obj = '';
|
|
||||||
protected $user_reviewer_info_obj = '';
|
|
||||||
protected $user_reviewer_obj = '';
|
|
||||||
protected $user_msg_obj = '';
|
|
||||||
protected $article_reviewer_obj = '';
|
|
||||||
|
|
||||||
public function __construct(\think\Request $request = null) {
|
public function __construct(\think\Request $request = null) {
|
||||||
parent::__construct($request);
|
parent::__construct($request);
|
||||||
$this->user_obj = Db::name('user');
|
|
||||||
$this->captcha_obj = Db::name('captcha');
|
|
||||||
$this->user_act_obj = Db::name('user_act');
|
|
||||||
$this->admin_obj = Db::name('admin');
|
|
||||||
$this->reviewer_major_obj = Db::name('reviewer_major');
|
|
||||||
$this->journal_obj = Db::name('journal');
|
|
||||||
$this->user_reviewer_obj = Db::name('user_reviewer_apply');
|
|
||||||
$this->user_reviewer_info_obj = Db::name('user_reviewer_info');
|
|
||||||
$this->reviewer_to_journal_obj = Db::name('reviewer_to_journal');
|
|
||||||
$this->article_obj = Db::name('article');
|
|
||||||
$this->user_msg_obj = Db::name('user_msg');
|
|
||||||
$this->article_msg_obj = Db::name('article_msg');
|
|
||||||
$this->article_author_obj = Db::name('article_author');
|
|
||||||
$this->country_obj = Db::name('country');
|
|
||||||
$this->article_reviewer_obj = Db::name('article_reviewer');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -257,6 +225,7 @@ class Admin extends Controller {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function reviewer() {
|
public function reviewer() {
|
||||||
|
die("service stop!!");
|
||||||
//接受参数
|
//接受参数
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
$journal_info = $this->journal_obj->where('journal_id', $data['journal'])->find();
|
$journal_info = $this->journal_obj->where('journal_id', $data['journal'])->find();
|
||||||
@@ -307,6 +276,7 @@ class Admin extends Controller {
|
|||||||
* 作者申请成为审稿人
|
* 作者申请成为审稿人
|
||||||
*/
|
*/
|
||||||
public function becameReviewer() {
|
public function becameReviewer() {
|
||||||
|
die("service stop!!");
|
||||||
//接受参数,查询参数
|
//接受参数,查询参数
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace app\api\controller;
|
namespace app\api\controller;
|
||||||
|
|
||||||
use think\Controller;
|
use app\api\controller\Base;
|
||||||
use think\Db;
|
use think\Db;
|
||||||
use think\Queue;
|
use think\Queue;
|
||||||
use think\Validate;
|
use think\Validate;
|
||||||
@@ -11,73 +11,13 @@ use think\Validate;
|
|||||||
* @title 文章接口
|
* @title 文章接口
|
||||||
* @description 文章接口
|
* @description 文章接口
|
||||||
*/
|
*/
|
||||||
class Article extends Controller
|
class Article extends Base
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $article_obj = '';
|
|
||||||
protected $country_obj = '';
|
|
||||||
protected $user_obj = '';
|
|
||||||
protected $user_act_obj = '';
|
|
||||||
protected $journal_obj = '';
|
|
||||||
protected $user_log_obj = '';
|
|
||||||
protected $user_reviewer_info_obj = '';
|
|
||||||
protected $reviewer_major_obj = '';
|
|
||||||
protected $reviewer_to_journal_obj = '';
|
|
||||||
protected $article_reviewer_question_obj = '';
|
|
||||||
protected $article_msg_obj = '';
|
|
||||||
protected $article_file_obj = '';
|
|
||||||
protected $article_reviewer_obj = '';
|
|
||||||
protected $article_author_obj = '';
|
|
||||||
protected $article_transfer_obj = '';
|
|
||||||
protected $chief_to_journal_obj = '';
|
|
||||||
protected $login_auto_obj = '';
|
|
||||||
protected $major_obj = "";
|
|
||||||
protected $major_to_journal_obj = '';
|
|
||||||
protected $reviewer_from_author_obj = '';
|
|
||||||
protected $article_dialog_obj = '';
|
|
||||||
protected $article_proposal_obj = '';
|
|
||||||
protected $article_response_to_reviewer_obj = '';
|
|
||||||
protected $user_black_obj = '';
|
|
||||||
protected $user_reviewer_recommend_obj = '';
|
|
||||||
protected $email_log_obj = '';
|
|
||||||
protected $email_template_obj = '';
|
|
||||||
protected $production_article_obj = '';
|
|
||||||
protected $company_top_obj = '';
|
|
||||||
protected $user_score_log_obj = '';
|
|
||||||
|
|
||||||
public function __construct(\think\Request $request = null)
|
public function __construct(\think\Request $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct($request);
|
||||||
$this->user_obj = Db::name('user');
|
|
||||||
$this->country_obj = Db::name('country');
|
|
||||||
$this->user_act_obj = Db::name('user_act');
|
|
||||||
$this->article_obj = Db::name('article');
|
|
||||||
$this->journal_obj = Db::name('journal');
|
|
||||||
$this->user_log_obj = Db::name('user_log');
|
|
||||||
$this->user_reviewer_info_obj = Db::name("user_reviewer_info");
|
|
||||||
$this->reviewer_major_obj = Db::name('reviewer_major');
|
|
||||||
$this->reviewer_to_journal_obj = Db::name('reviewer_to_journal');
|
|
||||||
$this->article_reviewer_question_obj = Db::name('article_reviewer_question');
|
|
||||||
$this->article_msg_obj = Db::name('article_msg');
|
|
||||||
$this->article_file_obj = Db::name('article_file');
|
|
||||||
$this->article_reviewer_obj = Db::name('article_reviewer');
|
|
||||||
$this->article_author_obj = Db::name('article_author');
|
|
||||||
$this->article_transfer_obj = Db::name('article_transfer');
|
|
||||||
$this->chief_to_journal_obj = Db::name('chief_to_journal');
|
|
||||||
$this->login_auto_obj = Db::name('login_auto');
|
|
||||||
$this->major_obj = Db::name("major");
|
|
||||||
$this->major_to_journal_obj = Db::name('major_to_journal');
|
|
||||||
$this->reviewer_from_author_obj = Db::name("reviewer_from_author");
|
|
||||||
$this->article_dialog_obj = Db::name('article_dialog');
|
|
||||||
$this->article_proposal_obj = Db::name('article_proposal');
|
|
||||||
$this->article_response_to_reviewer_obj = Db::name('article_response_to_reviewer');
|
|
||||||
$this->user_black_obj = Db::name('user_black');
|
|
||||||
$this->user_reviewer_recommend_obj = Db::name('user_reviewer_recommend');
|
|
||||||
$this->email_log_obj = Db::name('email_log');
|
|
||||||
$this->email_template_obj = Db::name('email_template');
|
|
||||||
$this->production_article_obj = Db::name('production_article');
|
|
||||||
$this->company_top_obj = Db::name('company_top');
|
|
||||||
$this->user_score_log_obj = Db::name('user_score_log');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -415,20 +355,6 @@ class Article extends Controller
|
|||||||
return json(['article' => $article_res, 'msg' => $article_msg, 'authors' => $author_res, 'suggest' => $suggest, 'transfer' => $transfer_res, 'transinfo' => $transfer_info, 'major' => $major]);
|
return json(['article' => $article_res, 'msg' => $article_msg, 'authors' => $author_res, 'suggest' => $suggest, 'transfer' => $transfer_res, 'transinfo' => $transfer_info, 'major' => $major]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getMajorStr($major_id)
|
|
||||||
{
|
|
||||||
$frag = '';
|
|
||||||
$major_info = $this->major_obj->where('major_id', $major_id)->find();
|
|
||||||
if ($major_info == null) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
if ($major_info['major_level'] == 1) {
|
|
||||||
return '';
|
|
||||||
} else {
|
|
||||||
$frag = $this->getMajorStr($major_info['pid']) . ' > ' . $major_info['major_title'];
|
|
||||||
}
|
|
||||||
return $frag;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1117,8 +1043,8 @@ class Article extends Controller
|
|||||||
return json(['code' => 1, 'msg' => "More than two available reviewer-comments are necessary before going next step."]);
|
return json(['code' => 1, 'msg' => "More than two available reviewer-comments are necessary before going next step."]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//接收必须查重小于30%
|
//接收必须查重小于20%
|
||||||
if ($data['state'] == 5 && $article_info['repetition'] > 30) {
|
if ($data['state'] == 5 && $article_info['repetition'] > 20) {
|
||||||
return jsonError("Submissions with a repetition rate greater than thirty percent will not be accepted");
|
return jsonError("Submissions with a repetition rate greater than thirty percent will not be accepted");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1406,6 +1332,16 @@ class Article extends Controller
|
|||||||
//接受参数
|
//接受参数
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
$this->article_obj->where('article_id', $data['articleId'])->update(['repetition' => $data['repefen'], 'repeurl' => $data['zipurl']]);
|
$this->article_obj->where('article_id', $data['articleId'])->update(['repetition' => $data['repefen'], 'repeurl' => $data['zipurl']]);
|
||||||
|
//当文章重复率大于50%时,拒稿,拉作者进黑名单
|
||||||
|
if($data['repefen']>=50){
|
||||||
|
$article_info = $this->article_obj->where('article_id',$data['articleId'])->find();
|
||||||
|
$user_info = $this->user_obj->where('user_id',$article_info['user_id'])->find();
|
||||||
|
$insert['user_id'] = $data['user_id'];
|
||||||
|
$insert['reason'] = "The author was blacklisted due to the check rate exceeded 50%";
|
||||||
|
$insert['black_ctime'] = time();
|
||||||
|
$this->user_black_obj->insert($insert);
|
||||||
|
$this->article_obj->where('article_id',$data['articleId'])->update(['state'=>3]);
|
||||||
|
}
|
||||||
return json(['code' => 0]);
|
return json(['code' => 0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2840,47 +2776,6 @@ class Article extends Controller
|
|||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 存储article文件历史信息
|
|
||||||
*/
|
|
||||||
private function save_article_file($article_id, $user_id, $username, $url, $type_name)
|
|
||||||
{
|
|
||||||
//首先确定数据库里面是否存在此数据
|
|
||||||
$res = $this->article_file_obj->where(['file_url' => $url])->find();
|
|
||||||
if ($res) { //编辑的时候不能重复存储
|
|
||||||
return true;
|
|
||||||
} else if ($type_name == 'picturesAndTables' && trim($url) == '') {
|
|
||||||
return true;
|
|
||||||
} else if ($type_name == 'coverLetter' && trim($url) == '') {
|
|
||||||
return true;
|
|
||||||
} else if ($type_name == 'totalpage' && trim($url) == '') {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
$insert_data['article_id'] = $article_id;
|
|
||||||
$insert_data['user_id'] = $user_id;
|
|
||||||
$insert_data['username'] = $username;
|
|
||||||
$insert_data['file_url'] = $url;
|
|
||||||
$insert_data['type_name'] = $type_name;
|
|
||||||
$insert_data['ctime'] = time();
|
|
||||||
return $this->article_file_obj->insertGetId($insert_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取文章作者字符串
|
|
||||||
* @param type $article_id
|
|
||||||
*/
|
|
||||||
public function getArticleAuthors($article_id)
|
|
||||||
{
|
|
||||||
$res = $this->article_author_obj->where('article_id', $article_id)->where('state', 0)->select();
|
|
||||||
$frag = '';
|
|
||||||
foreach ($res as $v) {
|
|
||||||
$frag .= $v['firstname'] . $v['lastname'] . ',';
|
|
||||||
}
|
|
||||||
return substr($frag, 0, -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 给审稿人发送邮件- 稿件的基本情况
|
// 给审稿人发送邮件- 稿件的基本情况
|
||||||
public function sendEmailToReviewer($articleId, $state)
|
public function sendEmailToReviewer($articleId, $state)
|
||||||
{
|
{
|
||||||
@@ -2974,7 +2869,7 @@ class Article extends Controller
|
|||||||
$this->article_obj->where('article_id', $article_id)->update(['editor_act' => 1]);
|
$this->article_obj->where('article_id', $article_id)->update(['editor_act' => 1]);
|
||||||
$author = $this->user_obj->where('user_id', $article['user_id'])->find();
|
$author = $this->user_obj->where('user_id', $article['user_id'])->find();
|
||||||
// 发邮件
|
// 发邮件
|
||||||
$content = 'Dear ' . $res['realname'] . ',<br>';
|
$content = 'Dear ' . $author['realname'] . ',<br>';
|
||||||
$content .= 'Thank you for contacting our editor. <br>ID: ' . $article['accept_sn'] . '.<br><br>';
|
$content .= 'Thank you for contacting our editor. <br>ID: ' . $article['accept_sn'] . '.<br><br>';
|
||||||
$content .= ' Your manuscript: ' . $article['accept_sn'] . ' has received a new reply; please login https://submission.tmrjournals.com/login to check. <br>';
|
$content .= ' Your manuscript: ' . $article['accept_sn'] . ' has received a new reply; please login https://submission.tmrjournals.com/login to check. <br>';
|
||||||
$content .= 'Sincerely,<br>' . $article['title'];
|
$content .= 'Sincerely,<br>' . $article['title'];
|
||||||
|
|||||||
@@ -261,6 +261,21 @@ class Auto extends Controller
|
|||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 补充doi缺失的全文内容
|
||||||
|
*/
|
||||||
|
// public function pushCrossrefForDoiB(){
|
||||||
|
// $url = "https://doi.crossref.org/servlet/deposit";
|
||||||
|
// $file = "D://cr396e3d57186c1f28fcb-6cc5.xml";
|
||||||
|
// $program['operation'] = "doDOICitUpload";
|
||||||
|
// $program['login_id'] = "books@tmrjournals.com";
|
||||||
|
// $program['login_passwd'] = "849192806pnX";
|
||||||
|
// $program['fname'] = $file;
|
||||||
|
// $res = myPost($url,$program);
|
||||||
|
// echo $res;
|
||||||
|
// // return jsonSuccess($res);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
public function qqqq()
|
public function qqqq()
|
||||||
{
|
{
|
||||||
|
|||||||
253
application/api/controller/Base.php
Normal file
253
application/api/controller/Base.php
Normal file
@@ -0,0 +1,253 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\api\controller;
|
||||||
|
|
||||||
|
use think\Controller;
|
||||||
|
use think\Db;
|
||||||
|
|
||||||
|
class Base extends Controller
|
||||||
|
{
|
||||||
|
|
||||||
|
protected $user_obj = '';
|
||||||
|
protected $captcha_obj = '';
|
||||||
|
protected $article_obj = '';
|
||||||
|
protected $user_act_obj = '';
|
||||||
|
protected $admin_obj = '';
|
||||||
|
protected $user_reviewer_obj = '';
|
||||||
|
protected $journal_obj = '';
|
||||||
|
protected $reviewer_major_obj = '';
|
||||||
|
protected $reviewer_to_journal_obj = '';
|
||||||
|
protected $user_reviewer_info_obj = '';
|
||||||
|
protected $user_msg_obj = '';
|
||||||
|
protected $chief_to_journal_obj = '';
|
||||||
|
protected $board_to_journal_obj = '';
|
||||||
|
protected $reviewer_from_author_obj = '';
|
||||||
|
protected $article_author_obj = '';
|
||||||
|
protected $user_black_obj = '';
|
||||||
|
protected $user_to_special_obj = '';
|
||||||
|
protected $user_register_check_obj = '';
|
||||||
|
protected $user_cert_obj = '';
|
||||||
|
protected $apply_board_obj = '';
|
||||||
|
protected $apply_yboard_obj = '';
|
||||||
|
protected $user_score_log_obj = '';
|
||||||
|
protected $user_index_log_obj = '';
|
||||||
|
protected $article_reviewer_obj = '';
|
||||||
|
protected $user_ash_obj = '';
|
||||||
|
protected $major_obj = '';
|
||||||
|
protected $user_to_yboard_obj = '';
|
||||||
|
protected $user_author_obj = '';
|
||||||
|
protected $country_obj = '';
|
||||||
|
protected $user_log_obj = '';
|
||||||
|
protected $article_reviewer_question_obj = '';
|
||||||
|
protected $article_msg_obj = '';
|
||||||
|
protected $article_file_obj = '';
|
||||||
|
protected $article_transfer_obj = '';
|
||||||
|
protected $login_auto_obj = '';
|
||||||
|
protected $major_to_journal_obj = '';
|
||||||
|
protected $article_dialog_obj = '';
|
||||||
|
protected $article_proposal_obj = '';
|
||||||
|
protected $article_response_to_reviewer_obj = '';
|
||||||
|
protected $user_reviewer_recommend_obj = '';
|
||||||
|
protected $email_log_obj = '';
|
||||||
|
protected $email_template_obj = '';
|
||||||
|
protected $production_article_obj = '';
|
||||||
|
protected $company_top_obj = '';
|
||||||
|
protected $user_cv_obj = '';
|
||||||
|
protected $ts_obj = '';
|
||||||
|
protected $ts_refer_obj = '';
|
||||||
|
protected $ts_frag_obj = '';
|
||||||
|
protected $online_obj = '';
|
||||||
|
protected $article_reviewer_file_obj = '';
|
||||||
|
protected $production_article_author_obj = '';
|
||||||
|
protected $production_article_organ_obj = '';
|
||||||
|
protected $production_article_refer_obj = '';
|
||||||
|
protected $production_article_author_to_organ_obj = '';
|
||||||
|
protected $production_article_frag_obj = '';
|
||||||
|
|
||||||
|
public function __construct(\think\Request $request = null)
|
||||||
|
{
|
||||||
|
parent::__construct($request);
|
||||||
|
$this->user_obj = Db::name('user');
|
||||||
|
$this->captcha_obj = Db::name('captcha');
|
||||||
|
$this->article_obj = Db::name('article');
|
||||||
|
$this->user_act_obj = Db::name('user_act');
|
||||||
|
$this->admin_obj = Db::name('admin');
|
||||||
|
$this->user_reviewer_obj = Db::name('user_reviewer_apply');
|
||||||
|
$this->journal_obj = Db::name('journal');
|
||||||
|
$this->reviewer_major_obj = Db::name('reviewer_major');
|
||||||
|
$this->reviewer_to_journal_obj = Db::name('reviewer_to_journal');
|
||||||
|
$this->user_reviewer_info_obj = Db::name('user_reviewer_info');
|
||||||
|
$this->user_msg_obj = Db::name('user_msg');
|
||||||
|
$this->chief_to_journal_obj = Db::name('chief_to_journal');
|
||||||
|
$this->board_to_journal_obj = Db::name('board_to_journal');
|
||||||
|
$this->reviewer_from_author_obj = Db::name('reviewer_from_author');
|
||||||
|
$this->article_author_obj = Db::name('article_author');
|
||||||
|
$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');
|
||||||
|
$this->apply_board_obj = Db::name('apply_board');
|
||||||
|
$this->apply_yboard_obj = Db::name('apply_yboard');
|
||||||
|
$this->user_score_log_obj = Db::name('user_score_log');
|
||||||
|
$this->user_index_log_obj = Db::name('user_index_log');
|
||||||
|
$this->article_reviewer_obj = Db::name('article_reviewer');
|
||||||
|
$this->user_ash_obj = Db::name('user_ash');
|
||||||
|
$this->major_obj = Db::name('major');
|
||||||
|
$this->user_to_yboard_obj = Db::name('user_to_yboard');
|
||||||
|
$this->country_obj = Db::name('country');
|
||||||
|
$this->user_log_obj = Db::name('user_log');
|
||||||
|
$this->article_reviewer_question_obj = Db::name('article_reviewer_question');
|
||||||
|
$this->article_msg_obj = Db::name('article_msg');
|
||||||
|
$this->article_file_obj = Db::name('article_file');
|
||||||
|
$this->article_transfer_obj = Db::name('article_transfer');
|
||||||
|
$this->login_auto_obj = Db::name('login_auto');
|
||||||
|
$this->major_to_journal_obj = Db::name('major_to_journal');
|
||||||
|
$this->article_dialog_obj = Db::name('article_dialog');
|
||||||
|
$this->article_proposal_obj = Db::name('article_proposal');
|
||||||
|
$this->article_response_to_reviewer_obj = Db::name('article_response_to_reviewer');
|
||||||
|
$this->user_reviewer_recommend_obj = Db::name('user_reviewer_recommend');
|
||||||
|
$this->email_log_obj = Db::name('email_log');
|
||||||
|
$this->email_template_obj = Db::name('email_template');
|
||||||
|
$this->production_article_obj = Db::name('production_article');
|
||||||
|
$this->company_top_obj = Db::name('company_top');
|
||||||
|
$this->user_cv_obj = Db::name('user_cv');
|
||||||
|
$this->ts_obj = Db::name('ts');
|
||||||
|
$this->ts_refer_obj = Db::name('ts_refer');
|
||||||
|
$this->ts_frag_obj = Db::name('ts_frag');
|
||||||
|
$this->online_obj = Db::name('online');
|
||||||
|
$this->article_reviewer_file_obj = Db::name('article_reviewer_file');
|
||||||
|
$this->production_article_obj = Db::name('production_article');
|
||||||
|
$this->production_article_author_obj = Db::name('production_article_author');
|
||||||
|
$this->production_article_organ_obj = Db::name('production_article_organ');
|
||||||
|
$this->production_article_refer_obj = Db::name('production_article_refer');
|
||||||
|
$this->production_article_author_to_organ_obj = Db::name('production_article_author_to_organ');
|
||||||
|
$this->production_article_frag_obj = Db::name('production_article_frag');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function pdfAddProof($article_id)
|
||||||
|
{
|
||||||
|
$p_info = $this->production_article_obj->where('article_id', $article_id)->where('state', 0)->find();
|
||||||
|
vendor('fpdf.fpdf');
|
||||||
|
vendor('fpdi/fpdi');
|
||||||
|
$pdf = new \FPDI();
|
||||||
|
$pageCount = $pdf->setSourceFile(ROOT_PATH . 'public' . DS . $p_info['file_pdf']);
|
||||||
|
for ($pageNo = 1; $pageNo <= $pageCount; $pageNo++) {
|
||||||
|
$templateId = $pdf->importPage($pageNo);
|
||||||
|
$size = $pdf->getTemplateSize($templateId);
|
||||||
|
if ($size['w'] > $size['h']) $pdf->AddPage('L', array($size['w'], $size['h']));
|
||||||
|
else $pdf->AddPage('P', array($size['w'], $size['h']));
|
||||||
|
$pdf->image(ROOT_PATH . 'public' . DS . 'pdf' . DS . 'bg2.png', 55, 25, 80);
|
||||||
|
$pdf->image(ROOT_PATH . 'public' . DS . 'pdf' . DS . 'bg2.png', 55, 155, 80);
|
||||||
|
$pdf->useTemplate($templateId);
|
||||||
|
}
|
||||||
|
$pdf->Output(ROOT_PATH . 'public' . DS . 'proofPDF' . DS . $article_id . '.pdf');
|
||||||
|
if ($p_info['file_sub'] != '' && substr($p_info['file_sub'], strripos($p_info['file_sub'], '.') + 1) == 'pdf') {
|
||||||
|
$pdf1 = new \FPDI();
|
||||||
|
$pageCount1 = $pdf1->setSourceFile(ROOT_PATH . 'public' . DS . "articleSUB" . DS . $p_info['file_sub']);
|
||||||
|
for ($pageNo = 1; $pageNo <= $pageCount1; $pageNo++) {
|
||||||
|
$templateId1 = $pdf1->importPage($pageNo);
|
||||||
|
$size = $pdf1->getTemplateSize($templateId1);
|
||||||
|
if ($size['w'] > $size['h']) $pdf1->AddPage('L', array($size['w'], $size['h']));
|
||||||
|
else $pdf1->AddPage('P', array($size['w'], $size['h']));
|
||||||
|
$pdf1->image(ROOT_PATH . 'public' . DS . 'pdf' . DS . 'bg2.png', 55, 25, 80);
|
||||||
|
$pdf1->image(ROOT_PATH . 'public' . DS . 'pdf' . DS . 'bg2.png', 55, 155, 80);
|
||||||
|
$pdf1->useTemplate($templateId1);
|
||||||
|
}
|
||||||
|
$pdf1->Output(ROOT_PATH . 'public' . DS . 'proofPDF' . DS . $article_id . 'SUB.pdf');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function createYboardCert($user_info,$journal_info,$start_time,$year){
|
||||||
|
if(!is_dir(ROOT_PATH . 'public' . DS . 'cert' . DS .$journal_info['journal_id'])){
|
||||||
|
mkdir(ROOT_PATH . 'public' . DS . 'cert' . DS .$journal_info['journal_id']);
|
||||||
|
}
|
||||||
|
$sj_num = rand(1000,9999);
|
||||||
|
$template = ROOT_PATH . 'public' . DS . 'cert' . DS . 'yboard_template.png';
|
||||||
|
$ziti = ROOT_PATH . 'public' . DS . 'zhengshu' . DS . 'siyuan.ttf';
|
||||||
|
$ziti1 = ROOT_PATH . 'public' . DS . 'zhengshu' . DS . 'Georgia0.ttf';
|
||||||
|
$image = \think\Image::open($template);
|
||||||
|
$ys = date("F Y",$start_time)." to ".date("F Y",strtotime("+ ".$year." year",$start_time));
|
||||||
|
$image->text($user_info['realname'], $ziti, 45, '#000000', [1060, 750])
|
||||||
|
->text($ys, $ziti1, 32, '#C49A6C', [1370, 1015])
|
||||||
|
->text(date("Y.m.d",$start_time), $ziti, 25, '#000000', [500, 1280])
|
||||||
|
->text($journal_info['title'], $ziti1, 36, '#C49A6C', [860, 930])
|
||||||
|
->save(ROOT_PATH . 'public' . DS . 'cert' . DS .$journal_info['journal_id'].DS. $user_info['user_id'].'_yboard_'.date('Y',$start_time).$sj_num . '.png');
|
||||||
|
return $journal_info['journal_id'].DS.$user_info['user_id'].'_yboard_'.date('Y',$start_time).$sj_num . '.png';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function majorids($major_id){
|
||||||
|
$frag[]=$major_id;
|
||||||
|
$list = $this->major_obj->where('pid',$major_id)->select();
|
||||||
|
foreach($list as $v){
|
||||||
|
$cache = self::majorids($v['major_id']);
|
||||||
|
$frag = array_merge($frag,$cache);
|
||||||
|
}
|
||||||
|
return $frag;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getMajorShu($major){
|
||||||
|
if($major==0){
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
$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'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMajorStr($major_id)
|
||||||
|
{
|
||||||
|
$frag = '';
|
||||||
|
$major_info = $this->major_obj->where('major_id', $major_id)->find();
|
||||||
|
if ($major_info == null) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
if ($major_info['major_level'] == 1) {
|
||||||
|
return 'Medicine';
|
||||||
|
} else {
|
||||||
|
$frag = $this->getMajorStr($major_info['pid']) . ' > ' . $major_info['major_title'];
|
||||||
|
}
|
||||||
|
return $frag;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function save_article_file($article_id, $user_id, $username, $url, $type_name)
|
||||||
|
{
|
||||||
|
//首先确定数据库里面是否存在此数据
|
||||||
|
$res = $this->article_file_obj->where(['file_url' => $url])->find();
|
||||||
|
if ($res) { //编辑的时候不能重复存储
|
||||||
|
return true;
|
||||||
|
} else if ($type_name == 'picturesAndTables' && trim($url) == '') {
|
||||||
|
return true;
|
||||||
|
} else if ($type_name == 'coverLetter' && trim($url) == '') {
|
||||||
|
return true;
|
||||||
|
} else if ($type_name == 'totalpage' && trim($url) == '') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
$insert_data['article_id'] = $article_id;
|
||||||
|
$insert_data['user_id'] = $user_id;
|
||||||
|
$insert_data['username'] = $username;
|
||||||
|
$insert_data['file_url'] = $url;
|
||||||
|
$insert_data['type_name'] = $type_name;
|
||||||
|
$insert_data['ctime'] = time();
|
||||||
|
return $this->article_file_obj->insertGetId($insert_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getArticleAuthors($article_id)
|
||||||
|
{
|
||||||
|
$res = $this->article_author_obj->where('article_id', $article_id)->where('state', 0)->select();
|
||||||
|
$frag = '';
|
||||||
|
foreach ($res as $v) {
|
||||||
|
$frag .= $v['firstname'] . $v['lastname'] . ',';
|
||||||
|
}
|
||||||
|
return substr($frag, 0, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -6,6 +6,7 @@ use think\Controller;
|
|||||||
use think\Db;
|
use think\Db;
|
||||||
use think\Env;
|
use think\Env;
|
||||||
use think\Queue;
|
use think\Queue;
|
||||||
|
use think\Validate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 主编相关接口
|
* @title 主编相关接口
|
||||||
@@ -240,10 +241,11 @@ class Chief extends Controller {
|
|||||||
|
|
||||||
//加上文章领域
|
//加上文章领域
|
||||||
foreach($list as $k => $v){
|
foreach($list as $k => $v){
|
||||||
$major = $this->reviewer_major_obj->where('major_id',$v['major_id'])->find();
|
$list[$k]['major_str'] = getMajorStr($v['major_id']);
|
||||||
$cmajor = $this->reviewer_major_obj->where('major_id',$v['cmajor_id'])->find();
|
// $major = $this->reviewer_major_obj->where('major_id',$v['major_id'])->find();
|
||||||
$list[$k]['major'] = $major['title'];
|
// $cmajor = $this->reviewer_major_obj->where('major_id',$v['cmajor_id'])->find();
|
||||||
$list[$k]['cmajor'] = $cmajor['title'];
|
// $list[$k]['major'] = $major['title'];
|
||||||
|
// $list[$k]['cmajor'] = $cmajor['title'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$re['articles'] = $list;
|
$re['articles'] = $list;
|
||||||
@@ -288,16 +290,18 @@ class Chief extends Controller {
|
|||||||
}
|
}
|
||||||
//加上文章领域
|
//加上文章领域
|
||||||
foreach($list as $k => $v){
|
foreach($list as $k => $v){
|
||||||
$major = $this->reviewer_major_obj->where('major_id',$v['major_id'])->find();
|
// $major = $this->reviewer_major_obj->where('major_id',$v['major_id'])->find();
|
||||||
$cmajor = $this->reviewer_major_obj->where('major_id',$v['cmajor_id'])->find();
|
// $cmajor = $this->reviewer_major_obj->where('major_id',$v['cmajor_id'])->find();
|
||||||
$list[$k]['major'] = $major['title'];
|
$list[$k]['major_str'] = getMajorStr($v['major_id']);
|
||||||
$list[$k]['cmajor'] = $cmajor['title'];
|
// $list[$k]['major'] = $major['title'];
|
||||||
|
// $list[$k]['cmajor'] = $cmajor['title'];
|
||||||
}
|
}
|
||||||
$re['count'] = $count;
|
$re['count'] = $count;
|
||||||
$re['articles'] = $list;
|
$re['articles'] = $list;
|
||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 获取主编期刊列表
|
* @title 获取主编期刊列表
|
||||||
* @description 获取主编期刊列表
|
* @description 获取主编期刊列表
|
||||||
|
|||||||
@@ -2,51 +2,19 @@
|
|||||||
|
|
||||||
namespace app\api\controller;
|
namespace app\api\controller;
|
||||||
|
|
||||||
use think\Controller;
|
use app\api\controller\Base;
|
||||||
use think\Db;
|
|
||||||
use think\Validate;
|
use think\Validate;
|
||||||
use app\api\controller\User as usercontroller;
|
use app\api\controller\User as usercontroller;
|
||||||
use think\Queue;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 期刊相关
|
* @title 期刊相关
|
||||||
* @description 期刊相关
|
* @description 期刊相关
|
||||||
*/
|
*/
|
||||||
class Journal extends Controller {
|
class Journal extends Base {
|
||||||
|
|
||||||
protected $user_obj = '';
|
|
||||||
protected $captcha_obj = '';
|
|
||||||
protected $journal_obj = '';
|
|
||||||
protected $user_act_obj = '';
|
|
||||||
protected $reviewer_major_obj = '';
|
|
||||||
protected $article_obj = '';
|
|
||||||
protected $article_msg_obj = '';
|
|
||||||
protected $article_author_obj = '';
|
|
||||||
protected $admin_obj = '';
|
|
||||||
protected $country_obj = '';
|
|
||||||
protected $reviewer_to_journal_obj = '';
|
|
||||||
protected $user_reviewer_info_obj = '';
|
|
||||||
protected $user_reviewer_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);
|
||||||
$this->user_obj = Db::name('user');
|
|
||||||
$this->captcha_obj = Db::name('captcha');
|
|
||||||
$this->user_act_obj = Db::name('user_act');
|
|
||||||
$this->admin_obj = Db::name('admin');
|
|
||||||
$this->reviewer_major_obj = Db::name('reviewer_major');
|
|
||||||
$this->journal_obj = Db::name('journal');
|
|
||||||
$this->user_reviewer_obj = Db::name('user_reviewer_apply');
|
|
||||||
$this->user_reviewer_info_obj = Db::name('user_reviewer_info');
|
|
||||||
$this->reviewer_to_journal_obj = Db::name('reviewer_to_journal');
|
|
||||||
$this->article_obj = Db::name('article');
|
|
||||||
$this->user_msg_obj = Db::name('user_msg');
|
|
||||||
$this->article_msg_obj = Db::name('article_msg');
|
|
||||||
$this->article_author_obj = Db::name('article_author');
|
|
||||||
$this->country_obj = Db::name('country');
|
|
||||||
$this->user_to_special_obj = Db::name('user_to_special');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ namespace app\api\controller;
|
|||||||
use Mpdf\Config\ConfigVariables;
|
use Mpdf\Config\ConfigVariables;
|
||||||
use Mpdf\Config\FontVariables;
|
use Mpdf\Config\FontVariables;
|
||||||
use Mpdf\Mpdf;
|
use Mpdf\Mpdf;
|
||||||
use think\Controller;
|
use app\api\controller\Base;
|
||||||
use think\Db;
|
use think\Db;
|
||||||
use think\Queue;
|
use think\Queue;
|
||||||
use think\Validate;
|
use think\Validate;
|
||||||
@@ -14,78 +14,12 @@ use think\Validate;
|
|||||||
* @title 公共管理相关
|
* @title 公共管理相关
|
||||||
* @description 公共管理相关
|
* @description 公共管理相关
|
||||||
*/
|
*/
|
||||||
class Production extends Controller
|
class Production extends Base
|
||||||
{
|
{
|
||||||
protected $article_obj = '';
|
|
||||||
protected $user_obj = '';
|
|
||||||
protected $user_act_obj = '';
|
|
||||||
protected $journal_obj = '';
|
|
||||||
protected $user_log_obj = '';
|
|
||||||
protected $user_reviewer_info_obj = '';
|
|
||||||
protected $reviewer_major_obj = '';
|
|
||||||
protected $reviewer_to_journal_obj = '';
|
|
||||||
protected $article_reviewer_question_obj = '';
|
|
||||||
protected $article_msg_obj = '';
|
|
||||||
protected $article_file_obj = '';
|
|
||||||
protected $article_reviewer_obj = '';
|
|
||||||
protected $article_author_obj = '';
|
|
||||||
protected $article_transfer_obj = '';
|
|
||||||
protected $chief_to_journal_obj = '';
|
|
||||||
protected $login_auto_obj = '';
|
|
||||||
protected $major_obj = "";
|
|
||||||
protected $major_to_journal_obj = '';
|
|
||||||
protected $reviewer_from_author_obj = '';
|
|
||||||
protected $article_dialog_obj = '';
|
|
||||||
protected $article_proposal_obj = '';
|
|
||||||
protected $user_black_obj = '';
|
|
||||||
protected $user_reviewer_recommend_obj = '';
|
|
||||||
protected $ts_obj = '';
|
|
||||||
protected $ts_refer_obj = '';
|
|
||||||
protected $ts_frag_obj = '';
|
|
||||||
protected $online_obj = '';
|
|
||||||
protected $production_article_obj = '';
|
|
||||||
protected $production_article_author_obj = '';
|
|
||||||
protected $production_article_organ_obj = '';
|
|
||||||
protected $production_article_refer_obj = '';
|
|
||||||
protected $production_article_author_to_organ_obj = '';
|
|
||||||
protected $production_article_frag_obj = '';
|
|
||||||
|
|
||||||
public function __construct(\think\Request $request = null)
|
public function __construct(\think\Request $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct($request);
|
||||||
$this->user_obj = Db::name('user');
|
|
||||||
$this->user_act_obj = Db::name('user_act');
|
|
||||||
$this->article_obj = Db::name('article');
|
|
||||||
$this->journal_obj = Db::name('journal');
|
|
||||||
$this->user_log_obj = Db::name('user_log');
|
|
||||||
$this->user_reviewer_info_obj = Db::name("user_reviewer_info");
|
|
||||||
$this->reviewer_major_obj = Db::name('reviewer_major');
|
|
||||||
$this->reviewer_to_journal_obj = Db::name('reviewer_to_journal');
|
|
||||||
$this->article_reviewer_question_obj = Db::name('article_reviewer_question');
|
|
||||||
$this->article_msg_obj = Db::name('article_msg');
|
|
||||||
$this->article_file_obj = Db::name('article_file');
|
|
||||||
$this->article_reviewer_obj = Db::name('article_reviewer');
|
|
||||||
$this->article_author_obj = Db::name('article_author');
|
|
||||||
$this->article_transfer_obj = Db::name('article_transfer');
|
|
||||||
$this->chief_to_journal_obj = Db::name('chief_to_journal');
|
|
||||||
$this->login_auto_obj = Db::name('login_auto');
|
|
||||||
$this->major_obj = Db::name("major");
|
|
||||||
$this->major_to_journal_obj = Db::name('major_to_journal');
|
|
||||||
$this->reviewer_from_author_obj = Db::name("reviewer_from_author");
|
|
||||||
$this->article_dialog_obj = Db::name('article_dialog');
|
|
||||||
$this->article_proposal_obj = Db::name('article_proposal');
|
|
||||||
$this->user_black_obj = Db::name('user_black');
|
|
||||||
$this->user_reviewer_recommend_obj = Db::name('user_reviewer_recommend');
|
|
||||||
$this->ts_obj = Db::name('ts');
|
|
||||||
$this->ts_refer_obj = Db::name('ts_refer');
|
|
||||||
$this->ts_frag_obj = Db::name('ts_frag');
|
|
||||||
$this->online_obj = Db::name('online');
|
|
||||||
$this->production_article_obj = Db::name('production_article');
|
|
||||||
$this->production_article_author_obj = Db::name('production_article_author');
|
|
||||||
$this->production_article_organ_obj = Db::name('production_article_organ');
|
|
||||||
$this->production_article_refer_obj = Db::name('production_article_refer');
|
|
||||||
$this->production_article_author_to_organ_obj = Db::name('production_article_author_to_organ');
|
|
||||||
$this->production_article_frag_obj = Db::name('production_article_frag');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1429,68 +1363,7 @@ class Production extends Controller
|
|||||||
self::pdfAddProof($article_id);
|
self::pdfAddProof($article_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function pdfAddProof($article_id)
|
|
||||||
{
|
|
||||||
$p_info = $this->production_article_obj->where('article_id', $article_id)->where('state', 0)->find();
|
|
||||||
vendor('fpdf.fpdf');
|
|
||||||
vendor('fpdi/fpdi');
|
|
||||||
$pdf = new \FPDI();
|
|
||||||
$pageCount = $pdf->setSourceFile(ROOT_PATH . 'public' . DS . $p_info['file_pdf']);
|
|
||||||
// iterate through all pages
|
|
||||||
for ($pageNo = 1; $pageNo <= $pageCount; $pageNo++) {
|
|
||||||
// import a page
|
|
||||||
$templateId = $pdf->importPage($pageNo);
|
|
||||||
|
|
||||||
// get the size of the imported page
|
|
||||||
$size = $pdf->getTemplateSize($templateId);
|
|
||||||
|
|
||||||
// create a page (landscape or portrait depending on the imported page size)
|
|
||||||
if ($size['w'] > $size['h']) $pdf->AddPage('L', array($size['w'], $size['h']));
|
|
||||||
else $pdf->AddPage('P', array($size['w'], $size['h']));
|
|
||||||
|
|
||||||
// use the imported page
|
|
||||||
// $pdf->useTemplate($templateId);
|
|
||||||
|
|
||||||
$pdf->image(ROOT_PATH . 'public' . DS . 'pdf' . DS . 'bg2.png', 55, 25, 80);
|
|
||||||
$pdf->image(ROOT_PATH . 'public' . DS . 'pdf' . DS . 'bg2.png', 55, 155, 80);
|
|
||||||
$pdf->useTemplate($templateId);
|
|
||||||
// $pdf->SetFont('Arial', 'B', '12');
|
|
||||||
// // sign with current date
|
|
||||||
// $pdf->SetXY(0, 0); // you should keep testing untill you find out correct x,y values
|
|
||||||
// $pdf->Write(7, date('Y-m-d'));
|
|
||||||
}
|
|
||||||
$pdf->Output(ROOT_PATH . 'public' . DS . 'proofPDF' . DS . $article_id . '.pdf');
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($p_info['file_sub'] != '' && substr($p_info['file_sub'], strripos($p_info['file_sub'], '.') + 1) == 'pdf') {
|
|
||||||
$pdf1 = new \FPDI();
|
|
||||||
$pageCount1 = $pdf1->setSourceFile(ROOT_PATH . 'public' . DS . "articleSUB" . DS . $p_info['file_sub']);
|
|
||||||
for ($pageNo = 1; $pageNo <= $pageCount1; $pageNo++) {
|
|
||||||
// import a page
|
|
||||||
$templateId1 = $pdf1->importPage($pageNo);
|
|
||||||
|
|
||||||
// get the size of the imported page
|
|
||||||
$size = $pdf1->getTemplateSize($templateId1);
|
|
||||||
|
|
||||||
// create a page (landscape or portrait depending on the imported page size)
|
|
||||||
if ($size['w'] > $size['h']) $pdf1->AddPage('L', array($size['w'], $size['h']));
|
|
||||||
else $pdf1->AddPage('P', array($size['w'], $size['h']));
|
|
||||||
|
|
||||||
// use the imported page
|
|
||||||
// $pdf->useTemplate($templateId);
|
|
||||||
|
|
||||||
$pdf1->image(ROOT_PATH . 'public' . DS . 'pdf' . DS . 'bg2.png', 55, 25, 80);
|
|
||||||
$pdf1->image(ROOT_PATH . 'public' . DS . 'pdf' . DS . 'bg2.png', 55, 155, 80);
|
|
||||||
$pdf1->useTemplate($templateId1);
|
|
||||||
// $pdf->SetFont('Arial', 'B', '12');
|
|
||||||
// // sign with current date
|
|
||||||
// $pdf->SetXY(0, 0); // you should keep testing untill you find out correct x,y values
|
|
||||||
// $pdf->Write(7, date('Y-m-d'));
|
|
||||||
}
|
|
||||||
$pdf1->Output(ROOT_PATH . 'public' . DS . 'proofPDF' . DS . $article_id . 'SUB.pdf');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 文章文件上传
|
* @title 文章文件上传
|
||||||
|
|||||||
@@ -2,75 +2,19 @@
|
|||||||
|
|
||||||
namespace app\api\controller;
|
namespace app\api\controller;
|
||||||
|
|
||||||
use think\Controller;
|
use app\api\controller\Base;
|
||||||
use think\Db;
|
|
||||||
use think\Queue;
|
|
||||||
use think\Validate;
|
use think\Validate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 公共管理相关
|
* @title 公共管理相关
|
||||||
* @description 公共管理相关
|
* @description 公共管理相关
|
||||||
*/
|
*/
|
||||||
class Publish extends Controller
|
class Publish extends Base
|
||||||
{
|
{
|
||||||
protected $article_obj = '';
|
|
||||||
protected $user_obj = '';
|
|
||||||
protected $user_act_obj = '';
|
|
||||||
protected $journal_obj = '';
|
|
||||||
protected $user_log_obj = '';
|
|
||||||
protected $user_reviewer_info_obj = '';
|
|
||||||
protected $reviewer_major_obj = '';
|
|
||||||
protected $reviewer_to_journal_obj = '';
|
|
||||||
protected $article_reviewer_question_obj = '';
|
|
||||||
protected $article_msg_obj = '';
|
|
||||||
protected $article_file_obj = '';
|
|
||||||
protected $article_reviewer_obj = '';
|
|
||||||
protected $article_author_obj = '';
|
|
||||||
protected $article_transfer_obj = '';
|
|
||||||
protected $chief_to_journal_obj = '';
|
|
||||||
protected $login_auto_obj = '';
|
|
||||||
protected $major_obj = "";
|
|
||||||
protected $major_to_journal_obj = '';
|
|
||||||
protected $reviewer_from_author_obj = '';
|
|
||||||
protected $article_dialog_obj = '';
|
|
||||||
protected $article_proposal_obj = '';
|
|
||||||
protected $user_black_obj = '';
|
|
||||||
protected $user_reviewer_recommend_obj = '';
|
|
||||||
protected $ts_obj = '';
|
|
||||||
protected $ts_refer_obj = '';
|
|
||||||
protected $ts_frag_obj = '';
|
|
||||||
protected $online_obj = '';
|
|
||||||
|
|
||||||
public function __construct(\think\Request $request = null)
|
public function __construct(\think\Request $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct($request);
|
||||||
$this->user_obj = Db::name('user');
|
|
||||||
$this->user_act_obj = Db::name('user_act');
|
|
||||||
$this->article_obj = Db::name('article');
|
|
||||||
$this->journal_obj = Db::name('journal');
|
|
||||||
$this->user_log_obj = Db::name('user_log');
|
|
||||||
$this->user_reviewer_info_obj = Db::name("user_reviewer_info");
|
|
||||||
$this->reviewer_major_obj = Db::name('reviewer_major');
|
|
||||||
$this->reviewer_to_journal_obj = Db::name('reviewer_to_journal');
|
|
||||||
$this->article_reviewer_question_obj = Db::name('article_reviewer_question');
|
|
||||||
$this->article_msg_obj = Db::name('article_msg');
|
|
||||||
$this->article_file_obj = Db::name('article_file');
|
|
||||||
$this->article_reviewer_obj = Db::name('article_reviewer');
|
|
||||||
$this->article_author_obj = Db::name('article_author');
|
|
||||||
$this->article_transfer_obj = Db::name('article_transfer');
|
|
||||||
$this->chief_to_journal_obj = Db::name('chief_to_journal');
|
|
||||||
$this->login_auto_obj = Db::name('login_auto');
|
|
||||||
$this->major_obj = Db::name("major");
|
|
||||||
$this->major_to_journal_obj = Db::name('major_to_journal');
|
|
||||||
$this->reviewer_from_author_obj = Db::name("reviewer_from_author");
|
|
||||||
$this->article_dialog_obj = Db::name('article_dialog');
|
|
||||||
$this->article_proposal_obj = Db::name('article_proposal');
|
|
||||||
$this->user_black_obj = Db::name('user_black');
|
|
||||||
$this->user_reviewer_recommend_obj = Db::name('user_reviewer_recommend');
|
|
||||||
$this->ts_obj = Db::name('ts');
|
|
||||||
$this->ts_refer_obj = Db::name('ts_refer');
|
|
||||||
$this->ts_frag_obj = Db::name('ts_frag');
|
|
||||||
$this->online_obj = Db::name('online');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2,60 +2,21 @@
|
|||||||
|
|
||||||
namespace app\api\controller;
|
namespace app\api\controller;
|
||||||
|
|
||||||
use think\Controller;
|
use app\api\controller\Base;
|
||||||
use think\Db;
|
use think\Db;
|
||||||
use think\Validate;
|
use think\Validate;
|
||||||
use TCPDF;
|
|
||||||
use think\Queue;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 审稿人接口
|
* @title 审稿人接口
|
||||||
* @description 审稿人接口
|
* @description 审稿人接口
|
||||||
*/
|
*/
|
||||||
class Reviewer extends Controller
|
class Reviewer extends Base
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $user_obj = '';
|
|
||||||
protected $user_reviewer_obj = '';
|
|
||||||
protected $journal_obj = '';
|
|
||||||
protected $reviewer_major_obj = '';
|
|
||||||
protected $reviewer_to_journal_obj = '';
|
|
||||||
protected $user_reviewer_info_obj = '';
|
|
||||||
protected $user_log_obj = '';
|
|
||||||
protected $article_obj = '';
|
|
||||||
protected $article_file_obj = '';
|
|
||||||
protected $article_reviewer_obj = '';
|
|
||||||
protected $article_reviewer_file_obj = '';
|
|
||||||
protected $article_reviewer_question_obj = '';
|
|
||||||
protected $chief_to_journal_obj = '';
|
|
||||||
protected $board_to_journal_obj = '';
|
|
||||||
protected $login_auto_obj = '';
|
|
||||||
protected $country_obj = '';
|
|
||||||
protected $user_reviewer_recommend_obj = '';
|
|
||||||
protected $article_msg_obj = '';
|
|
||||||
|
|
||||||
//put your code here
|
//put your code here
|
||||||
public function __construct(\think\Request $request = null)
|
public function __construct(\think\Request $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct($request);
|
||||||
$this->user_obj = Db::name('user');
|
|
||||||
$this->user_reviewer_obj = Db::name('user_reviewer_apply');
|
|
||||||
$this->journal_obj = Db::name('journal');
|
|
||||||
$this->reviewer_major_obj = Db::name('reviewer_major');
|
|
||||||
$this->reviewer_to_journal_obj = Db::name('reviewer_to_journal');
|
|
||||||
$this->user_reviewer_info_obj = Db::name('user_reviewer_info');
|
|
||||||
$this->user_log_obj = Db::name('user_log');
|
|
||||||
$this->article_obj = Db::name('article');
|
|
||||||
$this->article_file_obj = Db::name('article_file');
|
|
||||||
$this->article_reviewer_obj = Db::name('article_reviewer');
|
|
||||||
$this->article_reviewer_file_obj = Db::name('article_reviewer_file');
|
|
||||||
$this->article_reviewer_question_obj = Db::name('article_reviewer_question');
|
|
||||||
$this->chief_to_journal_obj = Db::name('chief_to_journal');
|
|
||||||
$this->board_to_journal_obj = Db::name('board_to_journal');
|
|
||||||
$this->login_auto_obj = Db::name('login_auto');
|
|
||||||
$this->country_obj = Db::name('country');
|
|
||||||
$this->user_reviewer_recommend_obj = Db::name('user_reviewer_recommend');
|
|
||||||
$this->article_msg_obj = Db::name('article_msg');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -250,6 +211,8 @@ class Reviewer extends Controller
|
|||||||
->where('t_user.account|t_user.email', 'like', '%' . $data['account'] . '%')
|
->where('t_user.account|t_user.email', 'like', '%' . $data['account'] . '%')
|
||||||
->where('t_user.state', 0)
|
->where('t_user.state', 0)
|
||||||
->find();
|
->find();
|
||||||
|
$check['majorshu'] = getMajorShu($check['major']);
|
||||||
|
$check['cvs'] = getReviewerCvs($check['user_id']);
|
||||||
$check['title'] = $check['technical'];
|
$check['title'] = $check['technical'];
|
||||||
$re['reviewer'] = $check;
|
$re['reviewer'] = $check;
|
||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
@@ -1402,7 +1365,6 @@ class Reviewer extends Controller
|
|||||||
$info_insert['introduction'] = isset($data['introduction']) ? trim($data['introduction']) : '';
|
$info_insert['introduction'] = isset($data['introduction']) ? trim($data['introduction']) : '';
|
||||||
$info_insert['company'] = isset($data['company']) ? trim($data['company']) : '';
|
$info_insert['company'] = isset($data['company']) ? trim($data['company']) : '';
|
||||||
$info_insert['major'] = $data['major'];
|
$info_insert['major'] = $data['major'];
|
||||||
$info_insert['cmajor'] = $data['cmajor'];
|
|
||||||
$info_insert['qualifications'] = isset($data['cv'])?trim($data['cv']):'';
|
$info_insert['qualifications'] = isset($data['cv'])?trim($data['cv']):'';
|
||||||
$info_insert['field'] = trim($data['field']);
|
$info_insert['field'] = trim($data['field']);
|
||||||
$res1 = $this->user_reviewer_info_obj->insertGetId($info_insert);
|
$res1 = $this->user_reviewer_info_obj->insertGetId($info_insert);
|
||||||
@@ -1469,7 +1431,7 @@ class Reviewer extends Controller
|
|||||||
$info_insert['introduction'] = isset($data['introduction']) ? trim($data['introduction']) : '';
|
$info_insert['introduction'] = isset($data['introduction']) ? trim($data['introduction']) : '';
|
||||||
$info_insert['company'] = isset($data['company']) ? trim($data['company']) : '';
|
$info_insert['company'] = isset($data['company']) ? trim($data['company']) : '';
|
||||||
$info_insert['major'] = $data['major'];
|
$info_insert['major'] = $data['major'];
|
||||||
$info_insert['cmajor'] = $data['cmajor'];
|
// $info_insert['cmajor'] = $data['cmajor'];
|
||||||
$info_insert['field'] = trim($data['field']);
|
$info_insert['field'] = trim($data['field']);
|
||||||
$info_insert['qualifications'] = trim($data['cv']);
|
$info_insert['qualifications'] = trim($data['cv']);
|
||||||
if ($reviewer_info == null) {
|
if ($reviewer_info == null) {
|
||||||
@@ -1602,10 +1564,11 @@ class Reviewer extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach($res as $k => $v){
|
foreach($res as $k => $v){
|
||||||
$major_res = $this->reviewer_major_obj->where('major_id', $v['major'])->column('title');
|
$res[$k]['major_title'] = getMajorStr($v['major']);
|
||||||
$res[$k]['major_title'] = $major_res ? $major_res[0] : '';
|
// $major_res = $this->reviewer_major_obj->where('major_id', $v['major'])->column('title');
|
||||||
$cmajor_res = $this->reviewer_major_obj->where('major_id', $v['cmajor'])->column('title');
|
// $res[$k]['major_title'] = $major_res ? $major_res[0] : '';
|
||||||
$res[$k]['cmajor_title'] = $cmajor_res ? $cmajor_res[0] : '';
|
// $cmajor_res = $this->reviewer_major_obj->where('major_id', $v['cmajor'])->column('title');
|
||||||
|
// $res[$k]['cmajor_title'] = $cmajor_res ? $cmajor_res[0] : '';
|
||||||
}
|
}
|
||||||
return json(['code' => 0, 'data' => $res, 'total' => $count]);
|
return json(['code' => 0, 'data' => $res, 'total' => $count]);
|
||||||
}
|
}
|
||||||
@@ -1693,116 +1656,45 @@ class Reviewer extends Controller
|
|||||||
public function searchReviewer()
|
public function searchReviewer()
|
||||||
{
|
{
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
|
$rule = new Validate([
|
||||||
|
'article_id'=>'require',
|
||||||
|
'pageIndex'=>'require',
|
||||||
|
'pageSize'=>'require'
|
||||||
|
]);
|
||||||
|
if(!$rule->check($data)){
|
||||||
|
return jsonError($rule->getError());
|
||||||
|
}
|
||||||
$article_info = $this->article_obj->where("article_id", $data['article_id'])->find();
|
$article_info = $this->article_obj->where("article_id", $data['article_id'])->find();
|
||||||
$noids = $this->article_reviewer_obj->where('article_id', $data['article_id'])->column('reviewer_id');
|
$noids = $this->article_reviewer_obj->where('article_id', $data['article_id'])->column('reviewer_id');
|
||||||
$limit_start = ($data['pageIndex'] - 1) * $data['pageSize'];
|
$limit_start = ($data['pageIndex'] - 1) * $data['pageSize'];
|
||||||
$list = [];
|
$list = [];
|
||||||
$gradewhere = '';
|
|
||||||
if(isset($data['grade'])){
|
$where['t_reviewer_to_journal.journal_id'] = $article_info['journal_id'];
|
||||||
$gradewhere = 't_reviewer_to_journal.grade = "'.$data['grade'].'"';
|
$where['t_reviewer_to_journal.reviewer_id'] = ['not in',$noids];
|
||||||
|
$where['t_reviewer_to_journal.state'] = 0;
|
||||||
|
if(isset($data['keywords'])&&$data['keywords']!=''){
|
||||||
|
$where['t_user_reviewer_info.introduction|t_user_reviewer_info.field|t_user.account|t_user.email|t_user.realname'] = ['like',"%" . $data["keywords"] . "%"];
|
||||||
}
|
}
|
||||||
$count = 0;
|
if(isset($data['major_id'])&&$data['major_id']!=0){
|
||||||
if ($data["keywords"] == "") {
|
$where['t_user_reviewer_info.major'] = $data['major_id'];
|
||||||
if ($data["major_id"] == 0) {
|
|
||||||
$list = $this->reviewer_to_journal_obj
|
|
||||||
->field("t_user.user_id,t_user.realname,t_reviewer_major.title cmajor,t_reviewer_to_journal.grade,t_user.account,t_user_reviewer_info.company,t_user_reviewer_info.field,t_user.rs_num,t_user.rd_num")
|
|
||||||
->join("t_user", "t_user.user_id = t_reviewer_to_journal.reviewer_id", "left")
|
|
||||||
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left")
|
|
||||||
->join("t_reviewer_major", "t_reviewer_major.major_id = t_user_reviewer_info.cmajor", "left")
|
|
||||||
->where('t_reviewer_to_journal.journal_id', $article_info['journal_id'])
|
|
||||||
->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids)
|
|
||||||
->where($gradewhere)
|
|
||||||
->where('t_reviewer_to_journal.state', 0)
|
|
||||||
->order("t_user.rs_num desc")
|
|
||||||
->limit($limit_start, $data['pageSize'])
|
|
||||||
->select();
|
|
||||||
$count = $this->reviewer_to_journal_obj
|
|
||||||
->where('t_reviewer_to_journal.journal_id', $article_info['journal_id'])
|
|
||||||
->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids)
|
|
||||||
->where($gradewhere)
|
|
||||||
->where('t_reviewer_to_journal.state', 0)
|
|
||||||
->count();
|
|
||||||
} else {
|
|
||||||
$list = $this->reviewer_to_journal_obj
|
|
||||||
->field("t_user.user_id,t_user.realname,t_reviewer_major.title cmajor,t_reviewer_to_journal.grade,t_user.account,t_user_reviewer_info.company,t_user_reviewer_info.field,t_user.rs_num,t_user.rd_num")
|
|
||||||
->join("t_user", "t_user.user_id = t_reviewer_to_journal.reviewer_id", "left")
|
|
||||||
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left")
|
|
||||||
->join("t_reviewer_major", "t_reviewer_major.major_id = t_user_reviewer_info.cmajor", "left")
|
|
||||||
->where('t_reviewer_to_journal.journal_id', $article_info['journal_id'])
|
|
||||||
->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids)
|
|
||||||
->where($gradewhere)
|
|
||||||
->where("t_user_reviewer_info.major", $data['major_id'])
|
|
||||||
->where('t_reviewer_to_journal.state', 0)
|
|
||||||
->order("t_user.rs_num desc")
|
|
||||||
->limit($limit_start, $data['pageSize'])
|
|
||||||
->select();
|
|
||||||
$count = $this->reviewer_to_journal_obj
|
|
||||||
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left")
|
|
||||||
->where('t_reviewer_to_journal.journal_id', $article_info['journal_id'])
|
|
||||||
->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids)
|
|
||||||
->where($gradewhere)
|
|
||||||
->where("t_user_reviewer_info.major", $data['major_id'])
|
|
||||||
->where('t_reviewer_to_journal.state', 0)
|
|
||||||
->count();
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if ($data["major_id"] == 0) {
|
|
||||||
$list = $this->reviewer_to_journal_obj
|
$list = $this->reviewer_to_journal_obj
|
||||||
->field("t_user.user_id,t_user.realname,t_reviewer_major.title cmajor,t_reviewer_to_journal.grade,t_user.account,t_user_reviewer_info.company,t_user_reviewer_info.field,t_user.rs_num,t_user.rd_num")
|
|
||||||
->join("t_user", "t_user.user_id = t_reviewer_to_journal.reviewer_id", "left")
|
->join("t_user", "t_user.user_id = t_reviewer_to_journal.reviewer_id", "left")
|
||||||
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left")
|
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left")
|
||||||
->join("t_reviewer_major", "t_reviewer_major.major_id = t_user_reviewer_info.cmajor", "left")
|
->where($where)
|
||||||
->where('t_reviewer_to_journal.journal_id', $article_info['journal_id'])
|
->order('t_user.rs_num desc')
|
||||||
->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids)
|
|
||||||
->where($gradewhere)
|
|
||||||
->where("t_user_reviewer_info.introduction|t_user_reviewer_info.field|t_user.account|t_user.email|t_user.realname", "like", "%" . $data["keywords"] . "%")
|
|
||||||
->where('t_reviewer_to_journal.state', 0)
|
|
||||||
->order("t_user.rs_num desc")
|
|
||||||
->limit($limit_start, $data['pageSize'])
|
->limit($limit_start, $data['pageSize'])
|
||||||
->select();
|
->select();
|
||||||
$count = $this->reviewer_to_journal_obj
|
$count = $this->reviewer_to_journal_obj
|
||||||
->join("t_user", "t_user.user_id = t_reviewer_to_journal.reviewer_id", "left")
|
->join("t_user", "t_user.user_id = t_reviewer_to_journal.reviewer_id", "left")
|
||||||
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left")
|
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left")
|
||||||
->where('t_reviewer_to_journal.journal_id', $article_info['journal_id'])
|
->where($where)
|
||||||
->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids)
|
|
||||||
->where($gradewhere)
|
|
||||||
->where("t_user_reviewer_info.introduction|t_user_reviewer_info.field|t_user.account|t_user.email|t_user.realname", "like", "%" . $data["keywords"] . "%")
|
|
||||||
->where('t_reviewer_to_journal.state', 0)
|
|
||||||
->count();
|
->count();
|
||||||
} else {
|
|
||||||
$list = $this->reviewer_to_journal_obj
|
|
||||||
->field("t_user.user_id,t_user.realname,t_reviewer_major.title cmajor,t_reviewer_to_journal.grade,t_user.account,t_user_reviewer_info.company,t_user_reviewer_info.field,t_user.rs_num,t_user.rd_num")
|
|
||||||
->join("t_user", "t_user.user_id = t_reviewer_to_journal.reviewer_id", "left")
|
|
||||||
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left")
|
|
||||||
->join("t_reviewer_major", "t_reviewer_major.major_id = t_user_reviewer_info.cmajor", "left")
|
|
||||||
->where('t_reviewer_to_journal.journal_id', $article_info['journal_id'])
|
|
||||||
->where("t_user_reviewer_info.major", $data['major_id'])
|
|
||||||
->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids)
|
|
||||||
->where($gradewhere)
|
|
||||||
->where("t_user_reviewer_info.introduction|t_user_reviewer_info.field|t_user.account|t_user.email|t_user.realname", "like", "%" . $data["keywords"] . "%")
|
|
||||||
->where('t_reviewer_to_journal.state', 0)
|
|
||||||
->order("t_user.rs_num desc")
|
|
||||||
->limit($limit_start, $data['pageSize'])
|
|
||||||
->select();
|
|
||||||
$count = $this->reviewer_to_journal_obj
|
|
||||||
->join("t_user", "t_user.user_id = t_reviewer_to_journal.reviewer_id", "left")
|
|
||||||
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_reviewer_to_journal.reviewer_id", "left")
|
|
||||||
->where('t_reviewer_to_journal.journal_id', $article_info['journal_id'])
|
|
||||||
->where("t_user_reviewer_info.major", $data['major_id'])
|
|
||||||
->where('t_reviewer_to_journal.reviewer_id', 'not in', $noids)
|
|
||||||
->where($gradewhere)
|
|
||||||
->where("t_user_reviewer_info.introduction|t_user_reviewer_info.field|t_user.account|t_user.email|t_user.realname", "like", "%" . $data["keywords"] . "%")
|
|
||||||
->where('t_reviewer_to_journal.state', 0)
|
|
||||||
->count();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach($list as $k => $v){
|
foreach($list as $k => $v){
|
||||||
|
$list[$k]['majorstr'] = getMajorStr($v['major']);
|
||||||
$list[$k]['now'] = $this->article_reviewer_obj->where('reviewer_id',$v['user_id'])->where('state',0)->count();
|
$list[$k]['now'] = $this->article_reviewer_obj->where('reviewer_id',$v['user_id'])->where('state',0)->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$re['reviewers'] = $list;
|
$re['reviewers'] = $list;
|
||||||
$re['count'] = $count;
|
$re['count'] = $count;
|
||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
|
|||||||
@@ -749,7 +749,6 @@ class Special extends Controller
|
|||||||
'realname' => 'require',
|
'realname' => 'require',
|
||||||
'article_id' => 'require',
|
'article_id' => 'require',
|
||||||
'major' => 'require',
|
'major' => 'require',
|
||||||
'cmajor' => 'require',
|
|
||||||
'country' => 'require'
|
'country' => 'require'
|
||||||
]);
|
]);
|
||||||
if (!$rule->check($data)) {
|
if (!$rule->check($data)) {
|
||||||
@@ -784,7 +783,7 @@ class Special extends Controller
|
|||||||
if ($uri == null) { //添加审稿人信息
|
if ($uri == null) { //添加审稿人信息
|
||||||
$insert_reviewer_info['reviewer_id'] = $reviewer_info['user_id'];
|
$insert_reviewer_info['reviewer_id'] = $reviewer_info['user_id'];
|
||||||
$insert_reviewer_info['major'] = $data['major'];
|
$insert_reviewer_info['major'] = $data['major'];
|
||||||
$insert_reviewer_info['cmajor'] = $data['cmajor'];
|
// $insert_reviewer_info['cmajor'] = $data['cmajor'];
|
||||||
$insert_reviewer_info['country'] = $data['country'];
|
$insert_reviewer_info['country'] = $data['country'];
|
||||||
$res2 = $this->user_reviewer_info_obj->insert($insert_reviewer_info);
|
$res2 = $this->user_reviewer_info_obj->insert($insert_reviewer_info);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace app\api\controller;
|
namespace app\api\controller;
|
||||||
|
|
||||||
use think\Controller;
|
use app\api\controller\Base;
|
||||||
use think\Db;
|
use think\Db;
|
||||||
use think\Queue;
|
use think\Queue;
|
||||||
use think\Validate;
|
use think\Validate;
|
||||||
@@ -11,66 +11,12 @@ use think\Validate;
|
|||||||
* @title 公共管理相关
|
* @title 公共管理相关
|
||||||
* @description 公共管理相关
|
* @description 公共管理相关
|
||||||
*/
|
*/
|
||||||
class Typeset extends Controller
|
class Typeset extends Base
|
||||||
{
|
{
|
||||||
protected $article_obj = '';
|
|
||||||
protected $user_obj = '';
|
|
||||||
protected $user_act_obj = '';
|
|
||||||
protected $journal_obj = '';
|
|
||||||
protected $user_log_obj = '';
|
|
||||||
protected $user_reviewer_info_obj = '';
|
|
||||||
protected $reviewer_major_obj = '';
|
|
||||||
protected $reviewer_to_journal_obj = '';
|
|
||||||
protected $article_reviewer_question_obj = '';
|
|
||||||
protected $article_msg_obj = '';
|
|
||||||
protected $article_file_obj = '';
|
|
||||||
protected $article_reviewer_obj = '';
|
|
||||||
protected $article_author_obj = '';
|
|
||||||
protected $article_transfer_obj = '';
|
|
||||||
protected $chief_to_journal_obj = '';
|
|
||||||
protected $login_auto_obj = '';
|
|
||||||
protected $major_obj = "";
|
|
||||||
protected $major_to_journal_obj = '';
|
|
||||||
protected $reviewer_from_author_obj = '';
|
|
||||||
protected $article_dialog_obj = '';
|
|
||||||
protected $article_proposal_obj = '';
|
|
||||||
protected $user_black_obj = '';
|
|
||||||
protected $user_reviewer_recommend_obj = '';
|
|
||||||
protected $ts_obj = '';
|
|
||||||
protected $ts_refer_obj = '';
|
|
||||||
protected $ts_frag_obj = '';
|
|
||||||
protected $online_obj = '';
|
|
||||||
|
|
||||||
public function __construct(\think\Request $request = null)
|
public function __construct(\think\Request $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct($request);
|
||||||
$this->user_obj = Db::name('user');
|
|
||||||
$this->user_act_obj = Db::name('user_act');
|
|
||||||
$this->article_obj = Db::name('article');
|
|
||||||
$this->journal_obj = Db::name('journal');
|
|
||||||
$this->user_log_obj = Db::name('user_log');
|
|
||||||
$this->user_reviewer_info_obj = Db::name("user_reviewer_info");
|
|
||||||
$this->reviewer_major_obj = Db::name('reviewer_major');
|
|
||||||
$this->reviewer_to_journal_obj = Db::name('reviewer_to_journal');
|
|
||||||
$this->article_reviewer_question_obj = Db::name('article_reviewer_question');
|
|
||||||
$this->article_msg_obj = Db::name('article_msg');
|
|
||||||
$this->article_file_obj = Db::name('article_file');
|
|
||||||
$this->article_reviewer_obj = Db::name('article_reviewer');
|
|
||||||
$this->article_author_obj = Db::name('article_author');
|
|
||||||
$this->article_transfer_obj = Db::name('article_transfer');
|
|
||||||
$this->chief_to_journal_obj = Db::name('chief_to_journal');
|
|
||||||
$this->login_auto_obj = Db::name('login_auto');
|
|
||||||
$this->major_obj = Db::name("major");
|
|
||||||
$this->major_to_journal_obj = Db::name('major_to_journal');
|
|
||||||
$this->reviewer_from_author_obj = Db::name("reviewer_from_author");
|
|
||||||
$this->article_dialog_obj = Db::name('article_dialog');
|
|
||||||
$this->article_proposal_obj = Db::name('article_proposal');
|
|
||||||
$this->user_black_obj = Db::name('user_black');
|
|
||||||
$this->user_reviewer_recommend_obj = Db::name('user_reviewer_recommend');
|
|
||||||
$this->ts_obj = Db::name('ts');
|
|
||||||
$this->ts_refer_obj = Db::name('ts_refer');
|
|
||||||
$this->ts_frag_obj = Db::name('ts_frag');
|
|
||||||
$this->online_obj = Db::name('online');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTypeSet()
|
public function getTypeSet()
|
||||||
@@ -535,41 +481,41 @@ class Typeset extends Controller
|
|||||||
return jsonSuccess([]);
|
return jsonSuccess([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* pdf文件加水印
|
// * pdf文件加水印
|
||||||
*/
|
// */
|
||||||
public function pdfAddProof()
|
// public function pdfAddProof()
|
||||||
{
|
// {
|
||||||
vendor('fpdf.fpdf');
|
// vendor('fpdf.fpdf');
|
||||||
vendor('fpdi/fpdi');
|
// vendor('fpdi/fpdi');
|
||||||
$pdf = new \FPDI();
|
// $pdf = new \FPDI();
|
||||||
$pageCount = $pdf->setSourceFile(ROOT_PATH . 'public' . DS.'pdf'.DS.'test.pdf');
|
// $pageCount = $pdf->setSourceFile(ROOT_PATH . 'public' . DS.'pdf'.DS.'test.pdf');
|
||||||
|
|
||||||
// iterate through all pages
|
// // iterate through all pages
|
||||||
for ($pageNo = 1; $pageNo <= $pageCount; $pageNo++) {
|
// for ($pageNo = 1; $pageNo <= $pageCount; $pageNo++) {
|
||||||
// import a page
|
// // import a page
|
||||||
$templateId = $pdf->importPage($pageNo);
|
// $templateId = $pdf->importPage($pageNo);
|
||||||
|
|
||||||
// get the size of the imported page
|
// // get the size of the imported page
|
||||||
$size = $pdf->getTemplateSize($templateId);
|
// $size = $pdf->getTemplateSize($templateId);
|
||||||
|
|
||||||
// create a page (landscape or portrait depending on the imported page size)
|
// // create a page (landscape or portrait depending on the imported page size)
|
||||||
if ($size['w'] > $size['h']) $pdf->AddPage('L', array($size['w'], $size['h']));
|
// if ($size['w'] > $size['h']) $pdf->AddPage('L', array($size['w'], $size['h']));
|
||||||
else $pdf->AddPage('P', array($size['w'], $size['h']));
|
// else $pdf->AddPage('P', array($size['w'], $size['h']));
|
||||||
|
|
||||||
// use the imported page
|
// // use the imported page
|
||||||
|
// // $pdf->useTemplate($templateId);
|
||||||
|
|
||||||
|
// $pdf->image(ROOT_PATH . 'public' . DS.'pdf'.DS.'bg2.png',55, 25, 80);
|
||||||
|
// $pdf->image(ROOT_PATH . 'public' . DS.'pdf'.DS.'bg2.png',55, 155, 80);
|
||||||
// $pdf->useTemplate($templateId);
|
// $pdf->useTemplate($templateId);
|
||||||
|
// // $pdf->SetFont('Arial', 'B', '12');
|
||||||
$pdf->image(ROOT_PATH . 'public' . DS.'pdf'.DS.'bg2.png',55, 25, 80);
|
// // // sign with current date
|
||||||
$pdf->image(ROOT_PATH . 'public' . DS.'pdf'.DS.'bg2.png',55, 155, 80);
|
// // $pdf->SetXY(0, 0); // you should keep testing untill you find out correct x,y values
|
||||||
$pdf->useTemplate($templateId);
|
// // $pdf->Write(7, date('Y-m-d'));
|
||||||
// $pdf->SetFont('Arial', 'B', '12');
|
// }
|
||||||
// // sign with current date
|
// $pdf->Output(ROOT_PATH . 'public' . DS.'pdf'.DS.'word.pdf');
|
||||||
// $pdf->SetXY(0, 0); // you should keep testing untill you find out correct x,y values
|
// }
|
||||||
// $pdf->Write(7, date('Y-m-d'));
|
|
||||||
}
|
|
||||||
$pdf->Output(ROOT_PATH . 'public' . DS.'pdf'.DS.'word.pdf');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取online的分期
|
* 获取online的分期
|
||||||
|
|||||||
@@ -2,49 +2,16 @@
|
|||||||
|
|
||||||
namespace app\api\controller;
|
namespace app\api\controller;
|
||||||
|
|
||||||
use think\Controller;
|
use app\api\controller\Base;
|
||||||
use think\Db;
|
|
||||||
use think\Validate;
|
use think\Validate;
|
||||||
|
|
||||||
|
|
||||||
class Ucenter extends Controller{
|
class Ucenter extends Base{
|
||||||
|
|
||||||
protected $user_obj = '';
|
|
||||||
protected $user_reviewer_info_obj = '';
|
|
||||||
protected $journal_obj = '';
|
|
||||||
protected $reviewer_to_journal_obj = '';
|
|
||||||
protected $article_reviewer_obj = '';
|
|
||||||
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 = '';
|
|
||||||
protected $apply_board_obj = '';
|
|
||||||
protected $apply_yboard_obj = '';
|
|
||||||
protected $user_score_log_obj = '';
|
|
||||||
protected $user_index_log_obj = '';
|
|
||||||
protected $user_to_yboard_obj = '';
|
|
||||||
|
|
||||||
public function __construct(\think\Request $request = null)
|
public function __construct(\think\Request $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct($request);
|
||||||
$this->user_obj = Db::name('user');
|
|
||||||
$this->user_reviewer_info_obj = Db::name("user_reviewer_info");
|
|
||||||
$this->journal_obj = Db::name('journal');
|
|
||||||
$this->reviewer_to_journal_obj = Db::name('reviewer_to_journal');
|
|
||||||
$this->article_reviewer_obj = Db::name('article_reviewer');
|
|
||||||
$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');
|
|
||||||
$this->apply_board_obj = Db::name('apply_board');
|
|
||||||
$this->apply_yboard_obj = Db::name('apply_yboard');
|
|
||||||
$this->user_score_log_obj = Db::name('user_score_log');
|
|
||||||
$this->user_index_log_obj = Db::name('user_index_log');
|
|
||||||
$this->user_to_yboard_obj = Db::name('user_to_yboard');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -81,6 +48,8 @@ class Ucenter extends Controller{
|
|||||||
->where('t_user.user_id',$data['user_id'])
|
->where('t_user.user_id',$data['user_id'])
|
||||||
->find();
|
->find();
|
||||||
|
|
||||||
|
$userInfo['baseInfo']['majorshu'] = $userInfo['baseInfo']['major']==0?'':getMajorShu($userInfo['baseInfo']['major']);
|
||||||
|
$userInfo['baseInfo']['majorStr'] = $userInfo['baseInfo']['major']==0?'':getMajorStr($userInfo['baseInfo']['major']);
|
||||||
//cv信息
|
//cv信息
|
||||||
$cvs = $this->user_cv_obj->where('user_id',$data['user_id'])->where('state',0)->select();
|
$cvs = $this->user_cv_obj->where('user_id',$data['user_id'])->where('state',0)->select();
|
||||||
$userInfo['cvs'] = $cvs;
|
$userInfo['cvs'] = $cvs;
|
||||||
@@ -253,13 +222,14 @@ class Ucenter extends Controller{
|
|||||||
if(isset($data['phone'])&&$data['phone']!=''){
|
if(isset($data['phone'])&&$data['phone']!=''){
|
||||||
$update['phone'] = $data['phone'];
|
$update['phone'] = $data['phone'];
|
||||||
}
|
}
|
||||||
|
$update['localname'] = isset($data['localname'])?trim($data['localname']):'';
|
||||||
$this->user_obj->where(['user_id'=>$data['user_id']])->update($update);
|
$this->user_obj->where(['user_id'=>$data['user_id']])->update($update);
|
||||||
$updata1=[
|
$updata1=[
|
||||||
'technical'=>$data['technical'],
|
'technical'=>$data['technical'],
|
||||||
'country'=>$data['country'],
|
'country'=>$data['country'],
|
||||||
'major'=>$data['major'],
|
'major'=>$data['major'],
|
||||||
'field'=>$data['field'],
|
'field'=>$data['field'],
|
||||||
'introduction'=>$data['introduction'],
|
'introduction'=>isset($data['introduction'])?$data['introduction']:'',
|
||||||
'company'=>$data['company']
|
'company'=>$data['company']
|
||||||
];
|
];
|
||||||
$this->user_reviewer_info_obj->where(['reviewer_id'=>$data['user_id']])->update($updata1);
|
$this->user_reviewer_info_obj->where(['reviewer_id'=>$data['user_id']])->update($updata1);
|
||||||
@@ -414,7 +384,7 @@ class Ucenter extends Controller{
|
|||||||
// 获取审稿人基本信息
|
// 获取审稿人基本信息
|
||||||
$res = $this->user_reviewer_info_obj->where(['reviewer_id'=>$userId])->find();
|
$res = $this->user_reviewer_info_obj->where(['reviewer_id'=>$userId])->find();
|
||||||
|
|
||||||
$res['majors'] = self::getMajorShu($res['major']);
|
$res['majors'] = getMajorShu($res['major']);
|
||||||
|
|
||||||
|
|
||||||
// 获取审稿人期刊
|
// 获取审稿人期刊
|
||||||
@@ -430,19 +400,6 @@ class Ucenter extends Controller{
|
|||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getMajorShu($major){
|
|
||||||
if($major==0){
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
$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: 编辑的期刊资料
|
* Notes: 编辑的期刊资料
|
||||||
* User: wangzhaocui
|
* User: wangzhaocui
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace app\api\controller;
|
namespace app\api\controller;
|
||||||
|
|
||||||
use think\Controller;
|
use app\api\controller\Base;
|
||||||
use think\Db;
|
use think\Db;
|
||||||
use think\captcha;
|
use think\captcha;
|
||||||
use think\Cache;
|
use think\Cache;
|
||||||
@@ -15,67 +15,12 @@ use think\Validate;
|
|||||||
* @title 用户相关接口
|
* @title 用户相关接口
|
||||||
* @description 用户相关接口
|
* @description 用户相关接口
|
||||||
*/
|
*/
|
||||||
class User extends Controller
|
class User extends Base
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $user_obj = '';
|
|
||||||
protected $captcha_obj = '';
|
|
||||||
protected $article_obj = '';
|
|
||||||
protected $user_act_obj = '';
|
|
||||||
protected $admin_obj = '';
|
|
||||||
protected $user_reviewer_obj = '';
|
|
||||||
protected $journal_obj = '';
|
|
||||||
protected $reviewer_major_obj = '';
|
|
||||||
protected $reviewer_to_journal_obj = '';
|
|
||||||
protected $user_reviewer_info_obj = '';
|
|
||||||
protected $user_msg_obj = '';
|
|
||||||
protected $chief_to_journal_obj = '';
|
|
||||||
protected $board_to_journal_obj = '';
|
|
||||||
protected $reviewer_from_author_obj = '';
|
|
||||||
protected $article_author_obj = '';
|
|
||||||
protected $user_black_obj = '';
|
|
||||||
protected $user_to_special_obj = '';
|
|
||||||
protected $user_register_check_obj = '';
|
|
||||||
protected $user_cert_obj = '';
|
|
||||||
protected $apply_board_obj = '';
|
|
||||||
protected $apply_yboard_obj = '';
|
|
||||||
protected $user_score_log_obj = '';
|
|
||||||
protected $user_index_log_obj = '';
|
|
||||||
protected $article_reviewer_obj = '';
|
|
||||||
protected $user_ash_obj = '';
|
|
||||||
protected $major_obj = '';
|
|
||||||
protected $user_to_yboard_obj = '';
|
|
||||||
|
|
||||||
public function __construct(\think\Request $request = null)
|
public function __construct(\think\Request $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct($request);
|
||||||
$this->user_obj = Db::name('user');
|
|
||||||
$this->captcha_obj = Db::name('captcha');
|
|
||||||
$this->article_obj = Db::name('article');
|
|
||||||
$this->user_act_obj = Db::name('user_act');
|
|
||||||
$this->admin_obj = Db::name('admin');
|
|
||||||
$this->user_reviewer_obj = Db::name('user_reviewer_apply');
|
|
||||||
$this->journal_obj = Db::name('journal');
|
|
||||||
$this->reviewer_major_obj = Db::name('reviewer_major');
|
|
||||||
$this->reviewer_to_journal_obj = Db::name('reviewer_to_journal');
|
|
||||||
$this->user_reviewer_info_obj = Db::name('user_reviewer_info');
|
|
||||||
$this->user_msg_obj = Db::name('user_msg');
|
|
||||||
$this->chief_to_journal_obj = Db::name('chief_to_journal');
|
|
||||||
$this->board_to_journal_obj = Db::name('board_to_journal');
|
|
||||||
$this->reviewer_from_author_obj = Db::name('reviewer_from_author');
|
|
||||||
$this->article_author_obj = Db::name('article_author');
|
|
||||||
$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');
|
|
||||||
$this->apply_board_obj = Db::name('apply_board');
|
|
||||||
$this->apply_yboard_obj = Db::name('apply_yboard');
|
|
||||||
$this->user_score_log_obj = Db::name('user_score_log');
|
|
||||||
$this->user_index_log_obj = Db::name('user_index_log');
|
|
||||||
$this->article_reviewer_obj = Db::name('article_reviewer');
|
|
||||||
$this->user_ash_obj = Db::name('user_ash');
|
|
||||||
$this->major_obj = Db::name('major');
|
|
||||||
$this->user_to_yboard_obj = Db::name('user_to_yboard');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function pstest(){
|
public function pstest(){
|
||||||
@@ -601,27 +546,8 @@ class User extends Controller
|
|||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function majorids($major_id){
|
|
||||||
$frag[]=$major_id;
|
|
||||||
$list = $this->major_obj->where('pid',$major_id)->select();
|
|
||||||
foreach($list as $v){
|
|
||||||
$cache = self::majorids($v['major_id']);
|
|
||||||
$frag = array_merge($frag,$cache);
|
|
||||||
}
|
|
||||||
return $frag;
|
|
||||||
}
|
|
||||||
private function getMajorShu($major){
|
|
||||||
if($major==0){
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
$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'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加灰库用户单个
|
* 添加灰库用户单个
|
||||||
@@ -662,20 +588,7 @@ class User extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private function getMajorStr($major_id)
|
|
||||||
{
|
|
||||||
$frag = '';
|
|
||||||
$major_info = $this->major_obj->where('major_id', $major_id)->find();
|
|
||||||
if ($major_info == null) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
if ($major_info['major_level'] == 1) {
|
|
||||||
return 'Medicine';
|
|
||||||
} else {
|
|
||||||
$frag = $this->getMajorStr($major_info['pid']) . ' > ' . $major_info['major_title'];
|
|
||||||
}
|
|
||||||
return $frag;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 灰库导入excel用户
|
* 灰库导入excel用户
|
||||||
@@ -987,7 +900,7 @@ class User extends Controller
|
|||||||
$app_info = $this->apply_yboard_obj->where('ap_yboard_id',$data['ap_yboard_id'])->find();
|
$app_info = $this->apply_yboard_obj->where('ap_yboard_id',$data['ap_yboard_id'])->find();
|
||||||
$user_info = $this->user_obj->where('user_id',$app_info['user_id'])->find();
|
$user_info = $this->user_obj->where('user_id',$app_info['user_id'])->find();
|
||||||
$journal_info = $this->journal_obj->where('journal_id',$app_info['journal_id'])->find();
|
$journal_info = $this->journal_obj->where('journal_id',$app_info['journal_id'])->find();
|
||||||
$check = $this->user_to_yboard_obj->where('user_id',$app_info['user_id'])->where('journal_id',$app_info['journal_id'])->where('start_date',"<=",$start_time)->where('end_date',"<=",$start_time)->find();
|
$check = $this->user_to_yboard_obj->where('user_id',$app_info['user_id'])->where('journal_id',$app_info['journal_id'])->where('start_date',"<=",$start_time)->where('end_date',">=",$start_time)->find();
|
||||||
if($check){
|
if($check){
|
||||||
return jsonError("Already exists");
|
return jsonError("Already exists");
|
||||||
}
|
}
|
||||||
@@ -1003,6 +916,37 @@ class User extends Controller
|
|||||||
return jsonSuccess([]);
|
return jsonSuccess([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加作者用户
|
||||||
|
*/
|
||||||
|
public function addUserForAuthor(){
|
||||||
|
$num = $this->request->post('num');
|
||||||
|
$num =1;
|
||||||
|
$cs['num'] = $num;
|
||||||
|
$url = 'http://journalapi.tmrjournals.com/public/index.php/master/Article/getArticleReportAuthors';
|
||||||
|
$list = object_to_array(json_decode(myPost($url, $cs)));
|
||||||
|
dump($list);
|
||||||
|
// foreach($list as $v){
|
||||||
|
// foreach($v['author'] as $val){
|
||||||
|
// $check_user = $this->user_obj->where('email',$val['email'])->where('state',0)->find();
|
||||||
|
// if(!$check_user){
|
||||||
|
// $ui['account'] = $val['email'];
|
||||||
|
// $ui['password'] = md5("123456qwe");
|
||||||
|
// $ui['email'] = $val['email'];
|
||||||
|
// $ui['realname'] = $val['author_name'];
|
||||||
|
// $ui['ctime'] = time();
|
||||||
|
// $uid = $this->user_obj->insertGetId($ui);
|
||||||
|
// $uir['reviewer_id'] = $uid;
|
||||||
|
// $uir['country'] = $val['author_country'];
|
||||||
|
// $this->user_reviewer_info_obj->insert($uir);
|
||||||
|
// $check_user = $this->user_obj->where('user_id',$uid)->find();
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拒绝青年科学家申请
|
* 拒绝青年科学家申请
|
||||||
*/
|
*/
|
||||||
@@ -1481,9 +1425,13 @@ class User extends Controller
|
|||||||
if ($reviewer_res != null) {
|
if ($reviewer_res != null) {
|
||||||
$roles[] = 'reviewer';
|
$roles[] = 'reviewer';
|
||||||
}
|
}
|
||||||
$yboard_res = $this->reviewer_to_journal_obj->where('reviewer_id', $user_info['user_id'])->where('is_yboard', 1)->where('state', 0)->find();
|
// $yboard_res = $this->reviewer_to_journal_obj->where('reviewer_id', $user_info['user_id'])->where('is_yboard', 1)->where('state', 0)->find();
|
||||||
|
// if ($yboard_res != null) {
|
||||||
|
// $roles[] = 'yboard';
|
||||||
|
// }
|
||||||
|
$yboard_res = $this->user_to_yboard_obj->where('user_id',$user_info['user_id'])->where('state',0)->find();
|
||||||
if($yboard_res != null){
|
if($yboard_res != null){
|
||||||
$roles[] = 'yboard';
|
$roles[] = "yboard";
|
||||||
}
|
}
|
||||||
$chief_res = $this->chief_to_journal_obj->where('user_id', $user_info['user_id'])->where('state', 0)->find();
|
$chief_res = $this->chief_to_journal_obj->where('user_id', $user_info['user_id'])->where('state', 0)->find();
|
||||||
if ($chief_res != null) {
|
if ($chief_res != null) {
|
||||||
@@ -2119,7 +2067,7 @@ class User extends Controller
|
|||||||
$insert_info['company'] = $apply_info['company'];
|
$insert_info['company'] = $apply_info['company'];
|
||||||
$insert_info['major'] = $apply_info['major'];
|
$insert_info['major'] = $apply_info['major'];
|
||||||
$insert_info['field'] = $apply_info['field'];
|
$insert_info['field'] = $apply_info['field'];
|
||||||
$insert_info['qualifications'] = $apply_info['qualifications'];
|
// $insert_info['qualifications'] = $apply_info['qualifications'];
|
||||||
$addinfo_res = $this->user_reviewer_info_obj->insertGetId($insert_info);
|
$addinfo_res = $this->user_reviewer_info_obj->insertGetId($insert_info);
|
||||||
$has_res = $this->user_obj->where('account', $apply_info['name'])->find();
|
$has_res = $this->user_obj->where('account', $apply_info['name'])->find();
|
||||||
} else {
|
} else {
|
||||||
@@ -2134,8 +2082,18 @@ class User extends Controller
|
|||||||
$insert_info['company'] = $apply_info['company'];
|
$insert_info['company'] = $apply_info['company'];
|
||||||
$insert_info['major'] = $apply_info['major'];
|
$insert_info['major'] = $apply_info['major'];
|
||||||
$insert_info['field'] = $apply_info['field'];
|
$insert_info['field'] = $apply_info['field'];
|
||||||
$insert_info['qualifications'] = $apply_info['qualifications'];
|
// $insert_info['qualifications'] = $apply_info['qualifications'];
|
||||||
$this->user_reviewer_info_obj->insert($insert_info);
|
$this->user_reviewer_info_obj->insert($insert_info);
|
||||||
|
}else{
|
||||||
|
$update_info['gender'] = $apply_info['gender'];
|
||||||
|
$update_info['technical'] = $apply_info['technical'];
|
||||||
|
$update_info['country'] = $apply_info['country'];
|
||||||
|
$update_info['introduction'] = $apply_info['introduction'];
|
||||||
|
$update_info['company'] = $apply_info['company'];
|
||||||
|
$update_info['major'] = $apply_info['major'];
|
||||||
|
$update_info['field'] = $apply_info['field'];
|
||||||
|
// $update_info['qualifications'] = $apply_info['qualifications'];
|
||||||
|
$this->user_reviewer_info_obj->where('reviewer_id',$has_res['user_id'])->update($update_info);
|
||||||
}
|
}
|
||||||
$add_res = true;
|
$add_res = true;
|
||||||
$addinfo_res = true;
|
$addinfo_res = true;
|
||||||
@@ -2436,37 +2394,21 @@ class User extends Controller
|
|||||||
|
|
||||||
return jsonSuccess($insert);
|
return jsonSuccess($insert);
|
||||||
}
|
}
|
||||||
private function createYboardCert($user_info,$journal_info,$start_time,$year){
|
|
||||||
if(!is_dir(ROOT_PATH . 'public' . DS . 'cert' . DS .$journal_info['journal_id'])){
|
|
||||||
mkdir(ROOT_PATH . 'public' . DS . 'cert' . DS .$journal_info['journal_id']);
|
|
||||||
}
|
|
||||||
$sj_num = rand(1000,9999);
|
|
||||||
$template = ROOT_PATH . 'public' . DS . 'cert' . DS . 'yboard_template.png';
|
|
||||||
$ziti = ROOT_PATH . 'public' . DS . 'zhengshu' . DS . 'siyuan.ttf';
|
|
||||||
$ziti1 = ROOT_PATH . 'public' . DS . 'zhengshu' . DS . 'Georgia0.ttf';
|
|
||||||
$image = \think\Image::open($template);
|
|
||||||
$ys = date("F Y",$start_time)." to ".date("F Y",strtotime("+ ".$year." year",$start_time));
|
|
||||||
$image->text($user_info['realname'], $ziti, 45, '#000000', [1060, 750])
|
|
||||||
->text($ys, $ziti1, 32, '#C49A6C', [1370, 1015])
|
|
||||||
->text(date("Y.m.d",$start_time), $ziti, 25, '#000000', [500, 1280])
|
|
||||||
->text($journal_info['title'], $ziti1, 36, '#C49A6C', [860, 930])
|
|
||||||
->save(ROOT_PATH . 'public' . DS . 'cert' . DS .$journal_info['journal_id'].DS. $user_info['user_id'].'_yboard_'.date('Y',$start_time).$sj_num . '.png');
|
|
||||||
return $journal_info['journal_id'].DS.$user_info['user_id'].'_yboard_'.date('Y',$start_time).$sj_num . '.png';
|
|
||||||
}
|
|
||||||
|
|
||||||
private function createCert($user_info,$journal_info,$year,$type){
|
|
||||||
//type:1编委,2青年科学家
|
|
||||||
$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])
|
// private function createCert($user_info,$journal_info,$year,$type){
|
||||||
->text($year, $ziti, 50, '#C49A6C', [1850, 505])
|
// //type:1编委,2青年科学家
|
||||||
->text($year, $ziti, 36, '#C49A6C', [1665, 1052])
|
// $template = ROOT_PATH . 'public' . DS . 'cert' . DS . 'cert_template.png';
|
||||||
->text($journal_info['title'], $ziti, 36, '#C49A6C', [920, 980])
|
// $ziti = ROOT_PATH . 'public' . DS . 'zhengshu' . DS . 'siyuan.ttf';
|
||||||
->save(ROOT_PATH . 'public' . DS . 'cert' . DS . $user_info['user_id'].'_'.$type.'_'.$year . '.png');
|
// $image = \think\Image::open($template);
|
||||||
return $user_info['user_id'].'_'.$type.'_'.$year . '.png';
|
|
||||||
}
|
// $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 $user_info['user_id'].'_'.$type.'_'.$year . '.png';
|
||||||
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 注册绑定orcid至我们的账户
|
* 注册绑定orcid至我们的账户
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ use think\Env;
|
|||||||
// | Author: 流年 <liu21st@gmail.com>
|
// | Author: 流年 <liu21st@gmail.com>
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// 应用公共文件
|
// 应用公共文件
|
||||||
function authcode($str) {
|
function authcode($str)
|
||||||
|
{
|
||||||
$key = substr(md5('ThinkPHP.CN'), 5, 8);
|
$key = substr(md5('ThinkPHP.CN'), 5, 8);
|
||||||
$str1 = substr(md5($str), 8, 10);
|
$str1 = substr(md5($str), 8, 10);
|
||||||
return md5($key . $str1);
|
return md5($key . $str1);
|
||||||
@@ -33,7 +34,8 @@ function authcode($str) {
|
|||||||
* @param $attachmentFile 附件 (string | array)
|
* @param $attachmentFile 附件 (string | array)
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function sendEmail($email = '', $title = '', $from_name = '', $content = '', $memail = '', $mpassword = '', $attachmentFile = '') {
|
function sendEmail($email = '', $title = '', $from_name = '', $content = '', $memail = '', $mpassword = '', $attachmentFile = '')
|
||||||
|
{
|
||||||
date_default_timezone_set('PRC');
|
date_default_timezone_set('PRC');
|
||||||
//Create a new PHPMailer instance
|
//Create a new PHPMailer instance
|
||||||
$mail = new PHPMailer;
|
$mail = new PHPMailer;
|
||||||
@@ -93,8 +95,7 @@ function sendEmail($email = '', $title = '', $from_name = '', $content = '', $me
|
|||||||
//send the message, check for errors
|
//send the message, check for errors
|
||||||
if (!$mail->send()) {
|
if (!$mail->send()) {
|
||||||
$status = 0;
|
$status = 0;
|
||||||
$data = "邮件发送失败" . $mail->ErrorInfo;
|
$data = "邮件发送失败" . $mail->ErrorInfo;;
|
||||||
;
|
|
||||||
} else {
|
} else {
|
||||||
$status = 1;
|
$status = 1;
|
||||||
$data = "邮件发送成功";
|
$data = "邮件发送成功";
|
||||||
@@ -102,7 +103,8 @@ function sendEmail($email = '', $title = '', $from_name = '', $content = '', $me
|
|||||||
return ['status' => $status, 'data' => $data]; //返回值(可选)
|
return ['status' => $status, 'data' => $data]; //返回值(可选)
|
||||||
}
|
}
|
||||||
|
|
||||||
function object_to_array($obj) {
|
function object_to_array($obj)
|
||||||
|
{
|
||||||
$obj = (array) $obj;
|
$obj = (array) $obj;
|
||||||
foreach ($obj as $k => $v) {
|
foreach ($obj as $k => $v) {
|
||||||
if (gettype($v) == 'resource') {
|
if (gettype($v) == 'resource') {
|
||||||
@@ -115,7 +117,8 @@ function object_to_array($obj) {
|
|||||||
return $obj;
|
return $obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_str(){
|
function get_str()
|
||||||
|
{
|
||||||
|
|
||||||
$length = 32;
|
$length = 32;
|
||||||
$str = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
$str = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||||
@@ -126,10 +129,10 @@ function get_str(){
|
|||||||
$randstr .= $str[$num];
|
$randstr .= $str[$num];
|
||||||
}
|
}
|
||||||
return md5($randstr . time());
|
return md5($randstr . time());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRandPassword(){
|
function getRandPassword()
|
||||||
|
{
|
||||||
|
|
||||||
$length = 8;
|
$length = 8;
|
||||||
$str = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
$str = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||||
@@ -140,11 +143,11 @@ function getRandPassword(){
|
|||||||
$randstr .= $str[$num];
|
$randstr .= $str[$num];
|
||||||
}
|
}
|
||||||
return $randstr;
|
return $randstr;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function proofState($article_id){
|
function proofState($article_id)
|
||||||
|
{
|
||||||
$p_article_obj = Db::name('production_article');
|
$p_article_obj = Db::name('production_article');
|
||||||
$p_article_obj->where('article_id', $article_id)->where('state', '<>', 1)->where('proof_etime', '<', time())->where('proof_state', 1)->update(['proof_state' => 2]);
|
$p_article_obj->where('article_id', $article_id)->where('state', '<>', 1)->where('proof_etime', '<', time())->where('proof_state', 1)->update(['proof_state' => 2]);
|
||||||
}
|
}
|
||||||
@@ -153,7 +156,8 @@ function proofState($article_id){
|
|||||||
* 生成文章sn号
|
* 生成文章sn号
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
function getArticleSN($abbr, $type) {
|
function getArticleSN($abbr, $type)
|
||||||
|
{
|
||||||
$str = $abbr;
|
$str = $abbr;
|
||||||
$str .= date('Y', time()) . $type . date('md', time());
|
$str .= date('Y', time()) . $type . date('md', time());
|
||||||
$where['accept_sn'] = ['like', "$str%"];
|
$where['accept_sn'] = ['like', "$str%"];
|
||||||
@@ -171,7 +175,8 @@ function getArticleSN($abbr, $type) {
|
|||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
|
|
||||||
function translateType($type) {
|
function translateType($type)
|
||||||
|
{
|
||||||
$frag = '';
|
$frag = '';
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case "A":
|
case "A":
|
||||||
@@ -244,7 +249,8 @@ function translateType($type) {
|
|||||||
return $frag;
|
return $frag;
|
||||||
}
|
}
|
||||||
|
|
||||||
function search_array_val($arr,$val){
|
function search_array_val($arr, $val)
|
||||||
|
{
|
||||||
foreach ($arr as $k => $v) {
|
foreach ($arr as $k => $v) {
|
||||||
if ($v == $val) {
|
if ($v == $val) {
|
||||||
return $k;
|
return $k;
|
||||||
@@ -256,7 +262,8 @@ function search_array_val($arr,$val){
|
|||||||
* GET 请求
|
* GET 请求
|
||||||
* @param string $url
|
* @param string $url
|
||||||
*/
|
*/
|
||||||
function myGet($url){
|
function myGet($url)
|
||||||
|
{
|
||||||
$oCurl = curl_init();
|
$oCurl = curl_init();
|
||||||
if (stripos($url, "https://") !== FALSE) {
|
if (stripos($url, "https://") !== FALSE) {
|
||||||
curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, FALSE);
|
curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||||
@@ -276,7 +283,8 @@ function myGet($url){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function my_doiToFrag($data){
|
function my_doiToFrag($data)
|
||||||
|
{
|
||||||
$ts_refer_obj = Db::name('ts_refer');
|
$ts_refer_obj = Db::name('ts_refer');
|
||||||
if ($data['refer_doi'] == '') {
|
if ($data['refer_doi'] == '') {
|
||||||
return 0;
|
return 0;
|
||||||
@@ -298,7 +306,8 @@ function my_doiToFrag($data){
|
|||||||
$ts_refer_obj->close();
|
$ts_refer_obj->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
function my_doiToFrag1($data){
|
function my_doiToFrag1($data)
|
||||||
|
{
|
||||||
$p_refer_obj = Db::name('production_article_refer');
|
$p_refer_obj = Db::name('production_article_refer');
|
||||||
if ($data['refer_doi'] == '') {
|
if ($data['refer_doi'] == '') {
|
||||||
return 0;
|
return 0;
|
||||||
@@ -325,7 +334,8 @@ function my_doiToFrag1($data){
|
|||||||
/**
|
/**
|
||||||
* 增加用户积分log信息
|
* 增加用户积分log信息
|
||||||
*/
|
*/
|
||||||
function addUserScoreLog($user_id,$score,$content,$ctime,$act='+'){
|
function addUserScoreLog($user_id, $score, $content, $ctime, $act = '+')
|
||||||
|
{
|
||||||
$score_obj = Db::name('user_score_log');
|
$score_obj = Db::name('user_score_log');
|
||||||
$insert['user_id'] = $user_id;
|
$insert['user_id'] = $user_id;
|
||||||
$insert['content'] = trim($content);
|
$insert['content'] = trim($content);
|
||||||
@@ -336,7 +346,8 @@ function addUserScoreLog($user_id,$score,$content,$ctime,$act='+'){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function my_doiToFrag2($data){
|
function my_doiToFrag2($data)
|
||||||
|
{
|
||||||
$p_refer_obj = Db::name('production_article_refer');
|
$p_refer_obj = Db::name('production_article_refer');
|
||||||
if ($data['refer_doi'] == '') {
|
if ($data['refer_doi'] == '') {
|
||||||
return 0;
|
return 0;
|
||||||
@@ -366,7 +377,6 @@ function my_doiToFrag2($data){
|
|||||||
$update['joura'] = $joura;
|
$update['joura'] = $joura;
|
||||||
$is_js = 0;
|
$is_js = 0;
|
||||||
if ($joura == trim($bj[0])) {
|
if ($joura == trim($bj[0])) {
|
||||||
|
|
||||||
}
|
}
|
||||||
$update['is_ja'] = $joura == trim($bj[0]) ? 0 : 1;
|
$update['is_ja'] = $joura == trim($bj[0]) ? 0 : 1;
|
||||||
$update['dateno'] = str_replace(' ', '', str_replace('-', '–', trim($bj[1])));
|
$update['dateno'] = str_replace(' ', '', str_replace('-', '–', trim($bj[1])));
|
||||||
@@ -378,7 +388,8 @@ function my_doiToFrag2($data){
|
|||||||
$p_refer_obj->close();
|
$p_refer_obj->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
function bekjournal($str){
|
function bekjournal($str)
|
||||||
|
{
|
||||||
preg_match("/[0-9]{4}/", $str, $math);
|
preg_match("/[0-9]{4}/", $str, $math);
|
||||||
$year = $math[0];
|
$year = $math[0];
|
||||||
$frag[0] = trim(substr($str, 0, stripos($str, $year)));
|
$frag[0] = trim(substr($str, 0, stripos($str, $year)));
|
||||||
@@ -386,7 +397,8 @@ function bekjournal($str){
|
|||||||
return $frag;
|
return $frag;
|
||||||
}
|
}
|
||||||
|
|
||||||
function formateJournal($fullname){
|
function formateJournal($fullname)
|
||||||
|
{
|
||||||
$obj = Db::name('journal_abbr');
|
$obj = Db::name('journal_abbr');
|
||||||
$r = $obj->where('full_name', $fullname)->find();
|
$r = $obj->where('full_name', $fullname)->find();
|
||||||
if ($r) {
|
if ($r) {
|
||||||
@@ -396,7 +408,8 @@ function formateJournal($fullname){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function prgeAuthor($author){
|
function prgeAuthor($author)
|
||||||
|
{
|
||||||
$a = explode(',', $author);
|
$a = explode(',', $author);
|
||||||
if (count($a) < 7) {
|
if (count($a) < 7) {
|
||||||
return $author . '.';
|
return $author . '.';
|
||||||
@@ -406,7 +419,8 @@ function prgeAuthor($author){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function my_tg_pushmail($data){
|
function my_tg_pushmail($data)
|
||||||
|
{
|
||||||
$res = sendEmail($data['email'], $data['title'], $data['title'], $data['content'], $data['tmail'], $data['tpassword'], $data['attachmentFile']);
|
$res = sendEmail($data['email'], $data['title'], $data['title'], $data['content'], $data['tmail'], $data['tpassword'], $data['attachmentFile']);
|
||||||
if (isset($res['status'])) {
|
if (isset($res['status'])) {
|
||||||
$log_obj = Db::name('email_log');
|
$log_obj = Db::name('email_log');
|
||||||
@@ -419,15 +433,51 @@ function my_tg_pushmail($data){
|
|||||||
$log_obj->insert($insert);
|
$log_obj->insert($insert);
|
||||||
$log_obj->close();
|
$log_obj->close();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getMajorStr($major_id)
|
||||||
|
{
|
||||||
|
$major_obj = Db::name('major');
|
||||||
|
$frag = '';
|
||||||
|
$major_info = $major_obj->where('major_id', $major_id)->find();
|
||||||
|
if ($major_info == null) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
if ($major_info['major_level'] == 1) {
|
||||||
|
return 'Medicine';
|
||||||
|
} else {
|
||||||
|
$frag = getMajorStr($major_info['pid']) . ' > ' . $major_info['major_title'];
|
||||||
|
}
|
||||||
|
return $frag;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getMajorShu($major)
|
||||||
|
{
|
||||||
|
$major_obj = Db::name('major');
|
||||||
|
if ($major == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$res = $major_obj->where('major_id', $major)->find();
|
||||||
|
if ($res['pid'] == 1) {
|
||||||
|
return $res['major_id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$p = getMajorShu($res['pid']);
|
||||||
|
return $p . ',' . $res['major_id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
function getReviewerCvs($reviewer_id){
|
||||||
|
$cvs = Db::name('user_cv')->where('user_id',$reviewer_id)->where('state',0)->select();
|
||||||
|
return $cvs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加usermsg
|
* 增加usermsg
|
||||||
*/
|
*/
|
||||||
function add_usermsg($userid, $content, $url) {
|
function add_usermsg($userid, $content, $url)
|
||||||
|
{
|
||||||
$msg_obj = Db::name('user_msg');
|
$msg_obj = Db::name('user_msg');
|
||||||
$msg_info = $msg_obj->where('user_id', $userid)
|
$msg_info = $msg_obj->where('user_id', $userid)
|
||||||
->where('url', $url)
|
->where('url', $url)
|
||||||
@@ -443,15 +493,18 @@ function add_usermsg($userid, $content, $url) {
|
|||||||
return $msg_obj->insert($msgdata);
|
return $msg_obj->insert($msgdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
function jsonSuccess($data) {
|
function jsonSuccess($data)
|
||||||
|
{
|
||||||
return json(['code' => 0, 'msg' => 'success', 'data' => $data]);
|
return json(['code' => 0, 'msg' => 'success', 'data' => $data]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function jsonError($msg) {
|
function jsonError($msg)
|
||||||
|
{
|
||||||
return json(['code' => 1, 'msg' => $msg]);
|
return json(['code' => 1, 'msg' => $msg]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function choiseJabbr($article_id, $jabbr) {
|
function choiseJabbr($article_id, $jabbr)
|
||||||
|
{
|
||||||
if ($article_id < 1799 && $jabbr == "Cancer Adv") {
|
if ($article_id < 1799 && $jabbr == "Cancer Adv") {
|
||||||
return "TMR Cancer";
|
return "TMR Cancer";
|
||||||
}
|
}
|
||||||
@@ -468,7 +521,8 @@ function choiseJabbr($article_id, $jabbr) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function myPost($url, $param = array()) {
|
function myPost($url, $param = array())
|
||||||
|
{
|
||||||
|
|
||||||
if (!is_array($param)) {
|
if (!is_array($param)) {
|
||||||
|
|
||||||
@@ -488,6 +542,8 @@ function myPost($url, $param = array()) {
|
|||||||
|
|
||||||
curl_setopt($httph, CURLOPT_POSTFIELDS, $param);
|
curl_setopt($httph, CURLOPT_POSTFIELDS, $param);
|
||||||
|
|
||||||
|
curl_setopt($httph, CURLOPT_SSL_VERIFYPEER, false);
|
||||||
|
|
||||||
// curl_setopt($httph, CURLOPT_RETURNTRANSFER,0);
|
// curl_setopt($httph, CURLOPT_RETURNTRANSFER,0);
|
||||||
// curl_setopt($httph, CURLOPT_HEADER,1);
|
// curl_setopt($httph, CURLOPT_HEADER,1);
|
||||||
|
|
||||||
@@ -498,7 +554,8 @@ function myPost($url, $param = array()) {
|
|||||||
return $rst;
|
return $rst;
|
||||||
}
|
}
|
||||||
|
|
||||||
function myPost1($url, $param = array()) {
|
function myPost1($url, $param = array())
|
||||||
|
{
|
||||||
|
|
||||||
if (!is_array($param)) {
|
if (!is_array($param)) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user