This commit is contained in:
wangjinlei
2022-11-23 14:48:15 +08:00
parent 0a92e69b83
commit ec59e99a8b
636 changed files with 59164 additions and 46329 deletions

View File

@@ -14,6 +14,7 @@ use think\Validate;
class Article extends Controller {
protected $article_obj = '';
protected $country_obj = '';
protected $user_obj = '';
protected $user_act_obj = '';
protected $journal_obj = '';
@@ -44,6 +45,7 @@ class Article extends Controller {
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');
@@ -313,14 +315,14 @@ class Article extends Controller {
// $suggest = $lastbean['content'];
// }
//查询审稿人审稿建议
if($article_res['state']==4){
// if($article_res['state']==4){
$suggest = $this->article_reviewer_obj->field('t_article_reviewer.*,t_article_reviewer_question.qu9_contents,t_article_reviewer_question.qu10_contents,t_article_reviewer_question.qu11_contents,t_article_reviewer_question.qu12_contents,t_article_reviewer_question.qu13_contents,t_article_reviewer_question.qu14_contents,t_article_reviewer_question.qu15_contents,t_article_reviewer_question.comments comments')
->join('t_article_reviewer_question','t_article_reviewer.art_rev_id=t_article_reviewer_question.art_rev_id','left')
->where('t_article_reviewer.state','<',4)
->where('t_article_reviewer.state','>',0)
->where('t_article_reviewer.article_id',$article_res['article_id'])
->select();
}
// }
//查询major信息
// $major_data = [];
@@ -1352,9 +1354,9 @@ class Article extends Controller {
. ' in the journal '.$journal_info['title'].'. <br>';
$tt .= 'Please bring into our knowledge if there is any potential Conflict of Interest. If you agree to review this manuscript, we ask you to complete your review and submit it by submission system within 14 days of receipt of the manuscript.<br><br>';
$tt .= 'Thank you for your consideration.<br> Look forward for your reply.<br>';
$tt .= '<a href="'.$this->creatLoginUrlForreviewer($reviewer_info,$res).'">Click here to review the article</a><br>';
$tt .= '<a href="'.$this->creatLoginUrlForreviewer($reviewer_info,$res).'">Click here to accept the invitation to review</a><br>';
// $tt .= '<a href="https://submission.tmrjournals.com/">Click here to review the article</a><br>';
$tt .= '<a href="'.$this->creatRejectUrlForReviewer($reviewer_info, $res).'">Click on the link to reject the review of this manuscript</a><br>';
$tt .= '<a href="'.$this->creatRejectUrlForReviewer($reviewer_info, $res).'">Click here to decline the invitation to review</a><br>';
$tt .= 'Your username:'.$reviewer_info['account'].'<br><br>';
$tt .= 'Your original password:123456qwe, if you have reset the password, please login with the new one or click the "<a href="https://submission.tmrjournals.com/retrieve">forgot password</a>".<br>';
$tt .= 'Sincerely,<br>Editorial Office<br>';
@@ -1627,6 +1629,7 @@ class Article extends Controller {
if ($res && $res_author && $transr && $res_file1 && $res_file2 && $res_file3 && $res_file4 && $res_log && $res_msg && $recommend_res) {
Db::commit();
$this->ai_scor($res);
return json(['code' => 0]);
} else {
Db::rollback();
@@ -1634,8 +1637,114 @@ class Article extends Controller {
}
}
public function ffff(){
$data = $this->request->post();
$this->ai_scor($data['article_id']);
}
/**
* 人工智能打分
*/
public function ai_scor($article_id){
$article_info = $this->article_obj->where('article_id',$article_id)->find();
$files = $this->article_file_obj->where('article_id',$article_id)->where('type_name','manuscirpt')
->order('ctime desc')
->limit(1)
->select();
$user_info = $this->user_obj->where('user_id',$article_info['user_id'])->find();
$fen = 0;
//h指数分数
$h_fen = 0;
if($user_info['google_index']>=20){
$h_fen = 4;
}elseif($user_info['google_index']>=6){
$h_fen = 3;
}elseif($user_info['google_index']>=2){
$h_fen = 1;
}else{
$h_fen = 0;
}
$fen += $h_fen;
//图表
$b_fen = 0;
$p_num = 0;
$url = "http://ts.tmrjournals.com/api/typeset/readPic";
$program['fileRoute'] = "https://submission.tmrjournals.com/public/" . $files[0]['file_url'];
$res = object_to_array(json_decode(myPost($url, $program)));
$wp = $res['data'];
$pics = $this->article_file_obj->where('article_id',$article_id)->where('type_name','picturesAndTables')->select();
$np = 0;
foreach($pics as $v){
$ext = substr(strrchr($v['file_url'],'.'),1);
if($ext=='zip'){
$cn = $this->readZip(ROOT_PATH . "public".DS.$v['file_url']);
$np += $cn;
}else{
$np++;
}
}
$p_num = $wp>$np?$wp:$np;
if($p_num>3){
$b_fen = 2;
}elseif($p_num>=1){
$b_fen = 1;
}else{
$b_fen = 0;
}
$fen += $b_fen;
//国家
$c_fen = 0;
$author = $this->article_author_obj->where('article_id',$article_id)->where('is_report',1)->find();
if($author['country']!=""){
$coun = $this->country_obj->where('en_name',$author['country'])->find();
if($coun&&$coun['is_hot']==1){
$c_fen = 1;
$fen+=1;
}
}
//单位
$dw_fen = 0;
//领域
$ly_fen = 0;
$m = $this->major_obj->where('major_id',$article_info['major_id'])->find();
if($m['is_hot']==1){
$ly_fen = 1;
$fen += 1;
}
//基金
$jj_fen = 0;
if(strlen($article_info['fund'])>15){
$jj_fen = 0.5;
$fen += 0.5;
}
// return $fen;
$updata['scoring'] = $fen;
$updata['h_fen'] = $h_fen;
$updata['b_fen'] = $b_fen;
$updata['c_fen'] = $c_fen;
$updata['dw_fen'] = $dw_fen;
$updata['ly_fen'] = $ly_fen;
$updata['jj_fen'] = $jj_fen;
$this->article_obj->where('article_id',$article_id)->update($updata);
}
private function readZip($file){
$zip = new \ZipArchive();
if($zip->open($file)===true){
return $zip->numFiles;
}else{
return 0;
}
}
/**
* 添加推荐审稿人
*/
public function addRecommentReviewer($reivewe,$journal_id,$user_id,$article_id){