20201112
This commit is contained in:
@@ -11,8 +11,10 @@ use think\Db;
|
|||||||
*/
|
*/
|
||||||
class Publish extends Controller{
|
class Publish extends Controller{
|
||||||
|
|
||||||
const JURL = 'http://www.tougao.com/api/Article/getArticleForJournal';
|
// const JURL = 'http://www.tougao.com/api/Article/getArticleForJournal';
|
||||||
// const JURL = 'http://journalapi.tmrjournals.com/public/index.php/master/Article/getJournalCites';
|
const JURL = 'http://api.tmrjournals.com/public/index.php/api/Article/getArticleForJournal';
|
||||||
|
const TJ_URL = 'http://api.tmrjournals.com/public/index.php/api/Super/main';
|
||||||
|
const AL_URL = 'http://api.tmrjournals.com/public/index.php/api/Super/getAllArticle';
|
||||||
|
|
||||||
protected $admin_obj = '';
|
protected $admin_obj = '';
|
||||||
protected $journal_obj = '';
|
protected $journal_obj = '';
|
||||||
@@ -81,10 +83,22 @@ class Publish extends Controller{
|
|||||||
$cs = [];
|
$cs = [];
|
||||||
$cs['issn'] = $v['issn'];
|
$cs['issn'] = $v['issn'];
|
||||||
$cs['ctime'] = $ctime;
|
$cs['ctime'] = $ctime;
|
||||||
|
$journals[$k]['last_time'] = $ctime;
|
||||||
$cache_arts = $this->object_to_array(json_decode(myPost(self::JURL,$cs)));
|
$cache_arts = $this->object_to_array(json_decode(myPost(self::JURL,$cs)));
|
||||||
$journals[$k]['arts'] = $cache_arts['data'];
|
// $journals[$k]['arts'] = $cache_arts['data'];
|
||||||
$journals[$k]['artCount'] = count($cache_arts['data']);
|
$count = is_array($cache_arts['data']['articles'])?count($cache_arts['data']['articles']):0;
|
||||||
|
$journals[$k]['artCount'] = $count;
|
||||||
}
|
}
|
||||||
|
for($i=0;$i<count($journals);$i++){
|
||||||
|
for($j=$i+1;$j<count($journals);$j++){
|
||||||
|
if($journals[$i]['mark']['mk']<$journals[$j]['mark']['mk']){
|
||||||
|
$cac = $journals[$i];
|
||||||
|
$journals[$i] = $journals[$j];
|
||||||
|
$journals[$j] = $cac;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$re['journals'] = $journals;
|
$re['journals'] = $journals;
|
||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
}
|
}
|
||||||
@@ -103,6 +117,112 @@ class Publish extends Controller{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 获取合规检测
|
||||||
|
* @description 获取合规检测
|
||||||
|
* @author wangjinlei
|
||||||
|
* @url /super/Publish/getTjJournal
|
||||||
|
* @method POST
|
||||||
|
*
|
||||||
|
* @return dates:数据@
|
||||||
|
* @dates LYL:录用率
|
||||||
|
* @dates CC:查重
|
||||||
|
* @dates WS:外审
|
||||||
|
* @dates SJ:时间
|
||||||
|
*/
|
||||||
|
public function getTjJournal(){
|
||||||
|
$res = myPost(self::TJ_URL);
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 获取质量评估
|
||||||
|
* @description 获取质量评估
|
||||||
|
* @author wangjinlei
|
||||||
|
* @url /super/Publish/getQuality
|
||||||
|
* @method POST
|
||||||
|
*
|
||||||
|
* @return YY:引用数
|
||||||
|
* @return TGL:投稿量
|
||||||
|
* @return FWL:发文量
|
||||||
|
* @return LX:文章类型
|
||||||
|
* @return GJH:国际化
|
||||||
|
* @return CK:创刊时间
|
||||||
|
*/
|
||||||
|
public function getQuality(){
|
||||||
|
$journals = $this->journal_obj->where('state',0)->select();
|
||||||
|
$res = $this->object_to_array(json_decode(myPost(self::AL_URL)));
|
||||||
|
$r = $res['data'];
|
||||||
|
$tg = [];
|
||||||
|
foreach ($r as $val){
|
||||||
|
$tg[$val['issn']] = $val['SJ'];
|
||||||
|
}
|
||||||
|
foreach ($journals as $k => $v){
|
||||||
|
$journals[$k]['YY'] = $this->article_obj->where('journal_id',$v['journal_id'])->where('state',0)->sum('cited');
|
||||||
|
$journals[$k]['TGL'] = isset($tg[$v['issn']])?$tg[$v['issn']]:[];
|
||||||
|
$journals[$k]['FWL'] = $this->getFWL($v['journal_id']);
|
||||||
|
$journals[$k]['LX'] = $this->getLX($v['journal_id']);
|
||||||
|
$journals[$k]['GJH'] = $this->getGJH($v['journal_id']);
|
||||||
|
$journals[$k]['CK'] = $this->getCK($v['journal_id']);
|
||||||
|
}
|
||||||
|
return jsonSuccess($journals);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取创刊时间
|
||||||
|
*/
|
||||||
|
private function getCK($journal_id){
|
||||||
|
$stage = $this->journal_stage_obj->where('journal_id',$journal_id)->where('state',0)->order('journal_stage_id')->limit(1)->select();
|
||||||
|
return $stage?$stage[0]['issue_date']:'';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取期刊的
|
||||||
|
*/
|
||||||
|
private function getFWL($journal_id){
|
||||||
|
$frag = [];
|
||||||
|
$frag['all'] = 0;
|
||||||
|
for($i=2016;$i<= intval(date('Y'));$i++){
|
||||||
|
$cstages = $this->journal_stage_obj->where('journal_id',$journal_id)->where('stage_year',$i)->where('state',0)->column('journal_stage_id');
|
||||||
|
$frag[$i] = $this->article_obj->where('journal_stage_id','in',$cstages)->where('state',0)->count();
|
||||||
|
$frag['all'] += $frag[$i];
|
||||||
|
}
|
||||||
|
return $frag;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private function getLX($journal_id){
|
||||||
|
$arts = $this->article_obj->where('journal_id',$journal_id)->where('state',0)->select();
|
||||||
|
$frag = [];
|
||||||
|
foreach ($arts as $v){
|
||||||
|
if(isset($frag[$v['type']])){
|
||||||
|
$kk = $v['type']==''?'Other':$v['type'];
|
||||||
|
$frag[$kk]++;
|
||||||
|
}else{
|
||||||
|
$kk = $v['type']==''?'Other':$v['type'];
|
||||||
|
$frag[$kk]=1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $frag;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getGJH($journal_id){
|
||||||
|
$arts = $this->article_obj->where('journal_id',$journal_id)->where('state',0)->column('article_id');
|
||||||
|
$auts = $this->article_author_obj->where('article_id','in',$arts)->where('state',0)->select();
|
||||||
|
$frag = [];
|
||||||
|
$frag['list'] = [];
|
||||||
|
$frag['countrys'] = 0;
|
||||||
|
foreach($auts as $v){
|
||||||
|
if(isset($frag['list'][$v['author_country']])){
|
||||||
|
$frag['list'][$v['author_country']]++;
|
||||||
|
}else{
|
||||||
|
$frag['list'][$v['author_country']] = 1;
|
||||||
|
$frag['countrys']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $frag;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 获取历史危险值
|
* @title 获取历史危险值
|
||||||
* @description 获取历史危险值
|
* @description 获取历史危险值
|
||||||
@@ -149,6 +269,21 @@ class Publish extends Controller{
|
|||||||
echo THINK_VERSION;
|
echo THINK_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function mymy(){
|
||||||
|
$last_stage = $this->journal_stage_obj
|
||||||
|
->where('journal_id',22)
|
||||||
|
->where('is_publish',1)
|
||||||
|
->where('state',0)
|
||||||
|
->order('journal_stage_id desc')
|
||||||
|
->limit(1)
|
||||||
|
->select();
|
||||||
|
echo '<pre>';
|
||||||
|
var_dump($last_stage);
|
||||||
|
echo '</pre>';
|
||||||
|
die;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计算危险指数
|
* 计算危险指数
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user