1
This commit is contained in:
@@ -889,6 +889,38 @@ class Article extends Base
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文章的作者(作者)
|
||||
*/
|
||||
|
||||
@@ -958,6 +958,7 @@ class Reviewer extends Base
|
||||
$update['stime'] = time();
|
||||
if($data['recommend']==3){
|
||||
$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;
|
||||
$this->article_reviewer_repeat_obj->where('art_rev_rep_id',$data['art_rev_rep_id'])->update($update);
|
||||
|
||||
@@ -472,6 +472,10 @@ class Special extends Controller
|
||||
|
||||
$user_res = $this->user_obj->where('account', $data['username'])->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();
|
||||
|
||||
@@ -614,34 +618,39 @@ class Special extends Controller
|
||||
/**
|
||||
* 人工智能打分
|
||||
*/
|
||||
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();
|
||||
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();
|
||||
|
||||
$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'];
|
||||
$g_index = 0;
|
||||
foreach($authors as $v){
|
||||
$c_user = $this->user_obj->where('email',$v['email'])->find();
|
||||
if($c_user['google_index']>=$g_index){
|
||||
$google_time = 0;
|
||||
foreach ($authors as $v) {
|
||||
$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) {
|
||||
$user_id = $c_user['user_id'];
|
||||
$g_index = $c_user['google_index'];
|
||||
}
|
||||
}
|
||||
$user_info = $this->user_obj->where('user_id',$user_id)->find();
|
||||
$user_info = $this->user_obj->where('user_id', $user_id)->find();
|
||||
$fen = 0;
|
||||
//h指数分数
|
||||
$h_fen = 0;
|
||||
if($user_info['google_index']>=20){
|
||||
if ($user_info['google_index'] >= 20) {
|
||||
$h_fen = 4;
|
||||
}elseif($user_info['google_index']>=6){
|
||||
} elseif ($user_info['google_index'] >= 6) {
|
||||
$h_fen = 3;
|
||||
}elseif($user_info['google_index']>=2){
|
||||
} elseif ($user_info['google_index'] >= 2) {
|
||||
$h_fen = 1;
|
||||
}else{
|
||||
} else {
|
||||
$h_fen = 0;
|
||||
}
|
||||
$fen += $h_fen;
|
||||
@@ -651,40 +660,105 @@ class Special extends Controller
|
||||
$url = $this->ts_base_url."api/typeset/readPic";
|
||||
$program['fileRoute'] = "https://submission.tmrjournals.com/public/" . $files[0]['file_url'];
|
||||
$res = object_to_array(json_decode(myPost($url, $program)));
|
||||
$wp = isset($res['data']['pic'])?$res['data']['pic']:2;
|
||||
$tp = isset($res['data']['table'])?$res['data']['table']:2;
|
||||
$wp = isset($res['data']['pic']) ? $res['data']['pic'] : 0;
|
||||
$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;
|
||||
foreach($pics as $v){
|
||||
$ext = substr(strrchr($v['file_url'],'.'),1);
|
||||
if($ext=='zip'){
|
||||
$cn = $this->readZip(ROOT_PATH . "public".DS.$v['file_url']);
|
||||
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++;
|
||||
} else {
|
||||
$np++;
|
||||
}
|
||||
}
|
||||
$p_num = $wp>$np?$wp:$np;
|
||||
$p_num = $wp > $np ? $wp : $np;
|
||||
|
||||
$all_num = $p_num+$tp;
|
||||
if($all_num>3){
|
||||
$all_num = $p_num + $tp;
|
||||
if ($all_num > 3) {
|
||||
$b_fen = 2;
|
||||
}elseif($all_num>=1){
|
||||
} elseif ($all_num >= 1) {
|
||||
$b_fen = 1;
|
||||
}else{
|
||||
} else {
|
||||
$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;
|
||||
|
||||
//图表扣分环节
|
||||
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;
|
||||
$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){
|
||||
$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;
|
||||
$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;
|
||||
}
|
||||
}
|
||||
//单位
|
||||
@@ -693,26 +767,27 @@ class Special extends Controller
|
||||
if ($report_author) {
|
||||
$ca_res = $this->company_top_obj->where('title', $report_author['company'])->find();
|
||||
if ($ca_res) {
|
||||
if($ca_res['company_id']<=100||($ca_res['company_id']>201&&$ca_res['company_id']<=301)){
|
||||
if ($ca_res['company_id'] <= 100 || ($ca_res['company_id'] > 201 && $ca_res['company_id'] <= 301)) {
|
||||
$dw_fen = 1.5;
|
||||
$fen += 1.5;
|
||||
}else{
|
||||
} else {
|
||||
$dw_fen = 1;
|
||||
$fen += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//领域
|
||||
$ly_fen = 0;
|
||||
$m = $this->major_obj->where('major_id',$article_info['major_id'])->find();
|
||||
if($m['is_hot']==1){
|
||||
$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'])>10){
|
||||
if (strlen($article_info['fund']) > 10) {
|
||||
$jj_fen = 0.5;
|
||||
$fen += 0.5;
|
||||
}
|
||||
@@ -725,7 +800,8 @@ class Special extends Controller
|
||||
$updata['ly_fen'] = $ly_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){
|
||||
|
||||
Reference in New Issue
Block a user