From b91936c95d5dbf94b39de10438f6c8364e8b6a6a Mon Sep 17 00:00:00 2001 From: chengxl Date: Wed, 4 Jun 2025 13:26:42 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=85=AC=E5=85=B1=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E6=96=B0=E5=A2=9E-=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common.php | 88 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/application/common.php b/application/common.php index 00c32ca..c9eeaff 100644 --- a/application/common.php +++ b/application/common.php @@ -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; +} From 1b424ebc516e441b2a918563c43258a195f0272e Mon Sep 17 00:00:00 2001 From: chengxl Date: Wed, 4 Jun 2025 13:27:14 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Articletype.php | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 application/api/controller/Articletype.php diff --git a/application/api/controller/Articletype.php b/application/api/controller/Articletype.php new file mode 100644 index 0000000..6a0edd1 --- /dev/null +++ b/application/api/controller/Articletype.php @@ -0,0 +1,31 @@ + 1,'msg' => 'success','data' => getArticleType()]); + } + + /** + * @title 医学类型接口 + * @description 医学类型接口 + */ + + public function getMedicalType(){ + return json_encode(['status' => 1,'msg' => 'success','data' => getMedicalType()]); + } +} +?> \ No newline at end of file From b11428882eff27a51273a89f2c7ed5a9bc9f4fff Mon Sep 17 00:00:00 2001 From: chengxl Date: Wed, 4 Jun 2025 13:27:39 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E9=98=9F=E5=88=97=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Queueinfo.php | 99 ++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 application/api/controller/Queueinfo.php diff --git a/application/api/controller/Queueinfo.php b/application/api/controller/Queueinfo.php new file mode 100644 index 0000000..dd079f5 --- /dev/null +++ b/application/api/controller/Queueinfo.php @@ -0,0 +1,99 @@ +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 '
';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 '
';var_dump($sQueueInfo,$sKey,$iNum);exit;
+
+    }
+}

From 2ea99e068890d59c565ea1ef631d39d5531afdf6 Mon Sep 17 00:00:00 2001
From: chengxl 
Date: Wed, 4 Jun 2025 13:28:23 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 application/api/controller/Crontask.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/application/api/controller/Crontask.php b/application/api/controller/Crontask.php
index 5d640fb..4e09a0a 100644
--- a/application/api/controller/Crontask.php
+++ b/application/api/controller/Crontask.php
@@ -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 = [