From 9ebd5108a26a4096b299e0d5457f7539cf8c14db Mon Sep 17 00:00:00 2001 From: chengxl Date: Fri, 4 Jul 2025 15:10:59 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=9F=E5=88=97=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/QueueJob.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/application/common/QueueJob.php b/application/common/QueueJob.php index eaf1c3d..f09f463 100644 --- a/application/common/QueueJob.php +++ b/application/common/QueueJob.php @@ -1,6 +1,7 @@ where('log_id',$iLogId)->limit(1)->update($aUpdate); return $result; } + + /** + * 写入Reids 防止1小时内重复操作 + */ + + public function setRedisLabel($aParam = []){ + //判断数据是否为空 + if(empty($aParam['redis_key'])){ + return false; + } + //获取值 + $sValue = $this->getRedisLabel($aParam['redis_key']); + if(!empty($sValue)){ + return false; + } + //写入 + return Cache::set($aParam['redis_key'], $aParam['redis_key'], 3600); + } + + /** + * 获取Reids值 + */ + public function getRedisLabel($sRedisKey = ''){ + if(empty($sRedisKey)){ + return ''; + } + return Cache::get($sRedisKey); + } } ?> \ No newline at end of file