Merge remote-tracking branch 'origin/master'
This commit is contained in:
31
application/api/controller/Articletype.php
Normal file
31
application/api/controller/Articletype.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\api\controller\Base;
|
||||
|
||||
/**
|
||||
* @title 文章类型接口
|
||||
* @description 文章接口
|
||||
*/
|
||||
class Articletype extends Base
|
||||
{
|
||||
|
||||
/**
|
||||
* @title 文章类型接口
|
||||
* @description 文章接口
|
||||
*/
|
||||
|
||||
public function getArticleType(){
|
||||
return json_encode(['status' => 1,'msg' => 'success','data' => getArticleType()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 医学类型接口
|
||||
* @description 医学类型接口
|
||||
*/
|
||||
|
||||
public function getMedicalType(){
|
||||
return json_encode(['status' => 1,'msg' => 'success','data' => getMedicalType()]);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -371,7 +371,7 @@ class Crontask extends Controller
|
||||
'ctime'=>['>',$sDate],
|
||||
'state'=>['in',[1,2,3]]
|
||||
];
|
||||
$aReviewer = Db::name('article_reviewer')->field('reviewer_id,count(article_id) as review_num_two_year ')->where($aWhere)->order('reviewer_id asc')->group('reviewer_id')->select();
|
||||
$aReviewer = Db::name('article_reviewer')->field('reviewer_id,count(article_id) as review_num_two_year')->where($aWhere)->order('reviewer_id asc')->group('reviewer_id')->select();
|
||||
|
||||
//查询审稿人数量不为0的审稿信息
|
||||
$aUserWhere = [
|
||||
|
||||
99
application/api/controller/Queueinfo.php
Normal file
99
application/api/controller/Queueinfo.php
Normal file
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
namespace app\api\controller;
|
||||
use app\api\controller\Base;
|
||||
use think\console\Command;
|
||||
use think\console\Input;
|
||||
use think\console\Output;
|
||||
use think\Config;
|
||||
use think\Request;
|
||||
|
||||
class Queueinfo extends Base
|
||||
{
|
||||
|
||||
public function __construct(\think\Request $request = null) {
|
||||
|
||||
$this->proxy = '';
|
||||
|
||||
parent::__construct($request);
|
||||
}
|
||||
// Redis队列展示
|
||||
public function show() {
|
||||
|
||||
$aParam = $this->request->post();
|
||||
$config = \think\Config::get('queue');
|
||||
|
||||
$config['queue'] = empty($aParam['queue_name']) ? 'ArticleAiCreateContent' : $aParam['queue_name'];
|
||||
$redis = new \Redis();
|
||||
$redis->connect($config['host'], $config['port']);
|
||||
|
||||
if (!empty($config['password'])) {
|
||||
$redis->auth($config['password']);
|
||||
}
|
||||
|
||||
$redis->select($config['select']);
|
||||
|
||||
// 获取不同队列类型的任务数
|
||||
$aQueue = ['ArticleAiCreateContent','WechatMaterial','WechatDraft','WechatQueryStatus'];
|
||||
foreach ($aQueue as $key => $value) {
|
||||
$types[$value] = [
|
||||
'pending' => 'queues:'.$value,
|
||||
'delayed' => 'queues:'.$value.':delayed',
|
||||
'failed' => 'queues:'.$value.':failed',
|
||||
'reserved' => 'queues:'.$value.':reserved',
|
||||
];
|
||||
}
|
||||
$counts = [];
|
||||
foreach ($types as $k => $value) {
|
||||
foreach ($value as $type => $key) {
|
||||
if($type == 'pending'){
|
||||
$counts[$k][$key] = $redis->lrange($key,0,-1);
|
||||
}else{
|
||||
$counts[$k][$key] = $redis->zRange($key,0,-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
echo '<pre>';var_dump($counts);
|
||||
}
|
||||
// Redis值删除
|
||||
public function remove() {
|
||||
|
||||
$aParam = $this->request->post();
|
||||
$config = \think\Config::get('queue');
|
||||
|
||||
$sQueueName = empty($aParam['queue_name']) ? 'ArticleAiCreateContent' : $aParam['queue_name'];
|
||||
$redis = new \Redis();
|
||||
$redis->connect($config['host'], $config['port']);
|
||||
|
||||
if (!empty($config['password'])) {
|
||||
$redis->auth($config['password']);
|
||||
}
|
||||
|
||||
$redis->select($config['select']);
|
||||
|
||||
|
||||
$sQueueType = empty($aParam['queue_type']) ? '' : $aParam['queue_type'];
|
||||
$iNum = empty($aParam['queue_num']) ? 0 : $aParam['queue_num'];
|
||||
if(empty($iNum) || empty($sQueueType)){
|
||||
echo '非法操作';
|
||||
exit;
|
||||
}
|
||||
// 获取不同队列类型的任务数
|
||||
$sKey = 'queues:'.$sQueueName;
|
||||
if(!empty($sQueueType)){
|
||||
$sKey .= ':'.$sQueueType;
|
||||
}
|
||||
$counts = [];
|
||||
if($sQueueType == 'pending'){
|
||||
$sQueueInfo = $redis->LINDEX($sKey,$iNum);
|
||||
}else{
|
||||
$sQueueInfo = $redis->ZRANGE($sKey,0,-1);
|
||||
}
|
||||
|
||||
if(!empty($sQueueInfo)){
|
||||
|
||||
}
|
||||
|
||||
echo '<pre>';var_dump($sQueueInfo,$sKey,$iNum);exit;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -346,6 +346,9 @@ function translateType($type)
|
||||
case 'MR':
|
||||
$frag = 'MINI REVIEW';
|
||||
break;
|
||||
case 'PERSP':
|
||||
$frag = 'PERSPECTIVE';
|
||||
break;
|
||||
default:
|
||||
$frag = 'OTHERS';
|
||||
break;
|
||||
@@ -1161,3 +1164,88 @@ function myPost1($url, $param = array())
|
||||
|
||||
return $rst;
|
||||
}
|
||||
/**
|
||||
* @title 文章类型接口
|
||||
* @description 文章接口
|
||||
*/
|
||||
function getArticleType(){
|
||||
|
||||
$aArticleType = [
|
||||
'base' => [
|
||||
|
||||
['name' => 'ARTICLE','value' => 'A'],
|
||||
['name' => 'REVIEW','value' => 'B'],
|
||||
['name' => 'CASE REPORT','value' => 'C'],
|
||||
['name' => 'RESEARCH PROPOSAL','value' => 'P'],
|
||||
['name' => 'NEWS','value' => 'N'],
|
||||
['name' => 'COMMENT','value' => 'T'],
|
||||
['name' => 'CORRECTION','value' => 'CT'],
|
||||
['name' => 'HYPOTHESIS','value' => 'HT'],
|
||||
['name' => 'PREFACE','value' => 'PF'],
|
||||
['name' => 'EDITORIAL','value' => 'ET'],
|
||||
['name' => 'REPORT','value' => 'RP'],
|
||||
['name' => 'LETTER','value' => 'LR'],
|
||||
['name' => 'EMPIRICAL FORMULA','value' => 'EF'],
|
||||
['name' => 'EXPERT CONSENSUS','value' => 'EC'],
|
||||
['name' => 'LETTER TO EDITOR','value' => 'LTE'],
|
||||
['name' => 'QUESTIONNAIRE INVESTIGATION','value' => 'QI'],
|
||||
['name' => 'CASE SERIES','value' => 'CS'],
|
||||
['name' => 'RETRACTION','value' => 'RT'],
|
||||
['name' => 'MINI REVIEW','value' => 'MR'],
|
||||
['name' => 'PERSPECTIVE','value' => 'PERSP'],
|
||||
['name' => 'OTHERS','value' => 'O']
|
||||
],
|
||||
'supplement' => [
|
||||
['name' => 'EVIDENCE-BASED MEDICINE','value' => 'EM'],
|
||||
['name' => 'PROTOCOL','value' => 'PT'],
|
||||
]
|
||||
];
|
||||
return $aArticleType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 医疗类型接口
|
||||
* @description 文章接口
|
||||
*/
|
||||
function getMedicalType(){
|
||||
|
||||
$aMedicalType = [
|
||||
['label' => 'None','value' => ''],
|
||||
['label' => 'ARTICLE','value' => 'Article'],
|
||||
['label' => 'REVIEW','value' => 'Review'],
|
||||
['label' => 'CASE REPORT','value' => 'Case report'],
|
||||
['label' => 'RESEARCH PROPOSAL','value' => 'Research proposal'],
|
||||
['label' => 'NEWS','value' => 'News'],
|
||||
['label' => 'COMMENT','value' => 'Comment'],
|
||||
['label' => 'CORRECTION','value' => 'Correction'],
|
||||
['label' => 'HYPOTHESIS','value' => 'Hypothesis'],
|
||||
['label' => 'PREFACE','value' => 'Preface'],
|
||||
['label' => 'EDITORIAL','value' => 'Editorial'],
|
||||
['label' => 'REPORT','value' => 'Report'],
|
||||
['label' => 'LETTER','value' => 'Letter'],
|
||||
['label' => 'EMPIRICAL FORMULA','value' => 'Empirical formula'],
|
||||
['label' => 'EVIDENCE-BASED MEDICINE','value' => 'Evidence-based medicine'],
|
||||
['label' => 'EXPERT CONSENSUS','value' => 'Expert consensus'],
|
||||
['label' => 'LETTER TO EDITOR','value' => 'Letter to editor'],
|
||||
['label' => 'QUESTIONNAIRE INVESTIGATION','value' => 'Questionnaire investigation'],
|
||||
['label' => 'PROTOCOL','value' => 'Protocol'],
|
||||
['label' => 'CASE SERIES','value' => 'Case Series'],
|
||||
['label' => 'RETRACTION','value' => 'Retraction'],
|
||||
['label' => 'MINI REVIEW','value' => 'Mini Review'],
|
||||
['label' => '内经难经','value' => '内经难经'],
|
||||
['label' => '伤寒金匮','value' => '伤寒金匮'],
|
||||
['label' => '神农本草经','value' => '神农本草经'],
|
||||
['label' => '温病研究','value' => '温病研究'],
|
||||
['label' => '唐宋方药','value' => '唐宋方药'],
|
||||
['label' => '金元各家','value' => '金元各家'],
|
||||
['label' => '明清经典','value' => '明清经典'],
|
||||
['label' => '中西汇通','value' => '中西汇通'],
|
||||
['label' => '太湖选粹','value' => '太湖选粹'],
|
||||
['label' => '针灸推拿','value' => '针灸推拿'],
|
||||
['label' => '名医名方','value' => '名医名方'],
|
||||
['label' => '新冠肺炎','value' => '新冠肺炎'],
|
||||
['label' => '书评','value' => '书评']
|
||||
];
|
||||
|
||||
return $aMedicalType;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user