1
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Controller;
|
||||
use app\api\controller\Base;
|
||||
use think\Db;
|
||||
use think\Queue;
|
||||
use think\Validate;
|
||||
@@ -11,73 +11,13 @@ use think\Validate;
|
||||
* @title 文章接口
|
||||
* @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)
|
||||
{
|
||||
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]);
|
||||
}
|
||||
|
||||
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."]);
|
||||
}
|
||||
}
|
||||
//接收必须查重小于30%
|
||||
if ($data['state'] == 5 && $article_info['repetition'] > 30) {
|
||||
//接收必须查重小于20%
|
||||
if ($data['state'] == 5 && $article_info['repetition'] > 20) {
|
||||
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();
|
||||
$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]);
|
||||
}
|
||||
|
||||
@@ -2840,47 +2776,6 @@ class Article extends Controller
|
||||
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)
|
||||
{
|
||||
@@ -2974,7 +2869,7 @@ class Article extends Controller
|
||||
$this->article_obj->where('article_id', $article_id)->update(['editor_act' => 1]);
|
||||
$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 .= ' 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'];
|
||||
|
||||
Reference in New Issue
Block a user