redis我们经常用到incr,那么如何给incr设置过期时间呢
>$today = date('Ymd');
$cacheKey = "withdraw".$today;
if(Cache::store('redis')->has($cacheKey)){
Cache::store('redis')->inc($cacheKey);
}else{
$expire = strtotime(date("Y-m-d",strtotime("+2 day"))) - time();
Cache::store('redis')->set($cacheKey,1,$expire);
}