This commit is contained in:
wangjinlei
2024-02-19 14:56:04 +08:00
parent 4fb600db4e
commit 122ff3852f
3 changed files with 149 additions and 40 deletions

View File

@@ -889,6 +889,38 @@ class Article extends Base
return jsonSuccess($re); return jsonSuccess($re);
} }
/**获取用户所投的文章
* @return \think\response\Json|void
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getArticlesByArticle(){
$data = $this->request->post();
$rule = new Validate([
"article_id" => "require"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$article_info = $this->article_obj->where('article_id',$data['article_id'])->find();
$list = $this->article_obj->field("t_article.*,t_journal.title journal_title")->join("t_journal","t_journal.journal_id = t_article.journal_id","left")->where("t_article.user_id",$article_info['user_id'])->select();
$re['user_articles'] = $list;
$authors = $this->article_author_obj->where('article_id',$data['article_id'])->where('state',0)->select();
foreach ($authors as $k => $v){
if($v['email']!=""&&$v['email']!="empty"){
$as = $this->article_obj->field("t_article.*,t_journal.title journal_title")->join("t_article_author","t_article.article_id = t_article_author.article_id","left")->join("t_journal","t_journal.journal_id = t_article.journal_id","left")->where("t_article.article_id","<>",$data['article_id'])->where("t_article_author.state",0)->where("t_article_author.email",$v['email'])->select();
}else{
$as = null;
}
$authors[$k]["articles"] = $as;
}
$re['author_articles'] = $authors;
return jsonSuccess($re);
}
/** /**
* 修改文章的作者(作者) * 修改文章的作者(作者)
*/ */

View File

@@ -958,6 +958,7 @@ class Reviewer extends Base
$update['stime'] = time(); $update['stime'] = time();
if($data['recommend']==3){ if($data['recommend']==3){
$update['content'] = isset($data['content'])?trim($data['content']):''; $update['content'] = isset($data['content'])?trim($data['content']):'';
$this->article_reviewer_obj->where("art_rev_id",$repeat_info['art_rev_id'])->update(['state'=>1]);
} }
$update['state'] = 1; $update['state'] = 1;
$this->article_reviewer_repeat_obj->where('art_rev_rep_id',$data['art_rev_rep_id'])->update($update); $this->article_reviewer_repeat_obj->where('art_rev_rep_id',$data['art_rev_rep_id'])->update($update);

View File

@@ -472,6 +472,10 @@ class Special extends Controller
$user_res = $this->user_obj->where('account', $data['username'])->find(); $user_res = $this->user_obj->where('account', $data['username'])->find();
$journal_info = $this->journal_obj->where('issn', $data['journal_issn'])->find(); $journal_info = $this->journal_obj->where('issn', $data['journal_issn'])->find();
$check_article = $this->article_obj->where('title',$data['title'])->find();
if($check_article){
return json(['code' => 1]);
}
Db::startTrans(); Db::startTrans();
@@ -614,7 +618,8 @@ class Special extends Controller
/** /**
* 人工智能打分 * 人工智能打分
*/ */
public function ai_scor($article_id){ public function ai_scor($article_id)
{
$article_info = $this->article_obj->where('article_id', $article_id)->find(); $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') $files = $this->article_file_obj->where('article_id', $article_id)->where('type_name', 'manuscirpt')
->order('ctime desc') ->order('ctime desc')
@@ -624,8 +629,12 @@ class Special extends Controller
$authors = $this->article_author_obj->where('article_id', $article_id)->where('is_report', 1)->where('state', 0)->select(); $authors = $this->article_author_obj->where('article_id', $article_id)->where('is_report', 1)->where('state', 0)->select();
$user_id = $article_info['user_id']; $user_id = $article_info['user_id'];
$g_index = 0; $g_index = 0;
$google_time = 0;
foreach ($authors as $v) { foreach ($authors as $v) {
$c_user = $this->user_obj->where('email', $v['email'])->find(); $c_user = $this->user_obj->where('email', $v['email'])->find();
if ($google_time < $c_user['google_time']) {//应对h指数为0的用户文章先取是否填写过h指数为0的情况
$google_time = $c_user['google_time'];
}
if ($c_user['google_index'] >= $g_index) { if ($c_user['google_index'] >= $g_index) {
$user_id = $c_user['user_id']; $user_id = $c_user['user_id'];
$g_index = $c_user['google_index']; $g_index = $c_user['google_index'];
@@ -651,8 +660,8 @@ class Special extends Controller
$url = $this->ts_base_url."api/typeset/readPic"; $url = $this->ts_base_url."api/typeset/readPic";
$program['fileRoute'] = "https://submission.tmrjournals.com/public/" . $files[0]['file_url']; $program['fileRoute'] = "https://submission.tmrjournals.com/public/" . $files[0]['file_url'];
$res = object_to_array(json_decode(myPost($url, $program))); $res = object_to_array(json_decode(myPost($url, $program)));
$wp = isset($res['data']['pic'])?$res['data']['pic']:2; $wp = isset($res['data']['pic']) ? $res['data']['pic'] : 0;
$tp = isset($res['data']['table'])?$res['data']['table']:2; $tp = isset($res['data']['table']) ? $res['data']['table'] : 0;
$pics = $this->article_file_obj->where('article_id', $article_id)->where('type_name', 'picturesAndTables')->select(); $pics = $this->article_file_obj->where('article_id', $article_id)->where('type_name', 'picturesAndTables')->select();
$np = 0; $np = 0;
@@ -676,7 +685,66 @@ class Special extends Controller
$b_fen = 0; $b_fen = 0;
} }
//当h指数为0 并且是编辑填写的
if ($user_info['google_index'] == 0 && $google_time > 0) {
if ($all_num >= 8) {
$b_fen = 4;
} elseif ($all_num == 7) {
$b_fen = 3.5;
} elseif ($all_num == 6) {
$b_fen = 3;
} elseif ($all_num == 5) {
$b_fen = 2;
} elseif ($all_num == 4) {
$b_fen = 1.5;
} elseif ($all_num >= 1) {
$b_fen = 1;
} else {
$b_fen = 0;
}
}
$fen += $b_fen; $fen += $b_fen;
//图表扣分环节
if ($article_info['journal_id'] == 1) {
$jan_fen = 0;
if ($article_info['type'] == "A") {
if ($all_num < 1) {
$jan_fen = 2;
} elseif ($all_num < 2) {
$jan_fen = 1;
} elseif ($all_num < 3) {
$jan_fen = 0.5;
}
} elseif ($article_info['type'] == "B") {
if ($all_num == 0) {
$jan_fen = 1;
}
}
$b_fen = $b_fen - $jan_fen;
$fen = $fen - $jan_fen;
} else {
$jan_fen1 = 0;
if ($article_info['type'] == "A") {
if ($all_num < 1) {
$jan_fen1 = 1;
}
if ($all_num < 2) {
$jan_fen1 = 0.5;
}
} elseif ($article_info['type'] == "B") {
if ($all_num == 0) {
$jan_fen1 = 0.5;
}
}
$b_fen = $b_fen - $jan_fen1;
$fen = $fen - $jan_fen1;
}
//国家 //国家
$c_fen = 0; $c_fen = 0;
$author = $this->article_author_obj->where('article_id', $article_id)->where('is_report', 1)->find(); $author = $this->article_author_obj->where('article_id', $article_id)->where('is_report', 1)->find();
@@ -685,6 +753,12 @@ class Special extends Controller
if ($coun && $coun['is_hot'] == 1) { if ($coun && $coun['is_hot'] == 1) {
$c_fen = 1; $c_fen = 1;
$fen += 1; $fen += 1;
} elseif ($coun && $coun['en_name'] != "China" && $coun['en_name'] != "India") {
$c_fen = 0.5;
$fen += 0.5;
} else {
$c_fen = 0;
$fen += 0;
} }
} }
//单位 //单位
@@ -702,6 +776,7 @@ class Special extends Controller
} }
} }
} }
//领域 //领域
$ly_fen = 0; $ly_fen = 0;
$m = $this->major_obj->where('major_id', $article_info['major_id'])->find(); $m = $this->major_obj->where('major_id', $article_info['major_id'])->find();
@@ -726,6 +801,7 @@ class Special extends Controller
$updata['jj_fen'] = $jj_fen; $updata['jj_fen'] = $jj_fen;
$this->article_obj->where('article_id', $article_id)->update($updata); $this->article_obj->where('article_id', $article_id)->update($updata);
return jsonSuccess([]);
} }
private function readZip($file){ private function readZip($file){