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