This commit is contained in:
ASUS 2025-10-22 15:36:46 +08:00
parent 0d9f9b101a
commit d3964d700b
1 changed files with 13 additions and 6 deletions

View File

@ -361,14 +361,21 @@ class Base extends Model
$table = Redis::get('time_discount:info');
if($table) {
$table_arr = json_decode($table, true);
foreach ($table_arr as $k => $v) {
if(!Gateway::getClientCountByGroup($v)) {
print_r($v . '过期');
unset($table_arr[$k]);
Redis::del($v);
if(is_array($table_arr)) {
foreach ($table_arr as $k => $v) {
if(!Gateway::getClientCountByGroup(str_replace(':time_discount', '', $v))) {
print_r($v . '过期');
unset($table_arr[$k]);
Redis::del($v);
}
}
Redis::set('time_discount:info', json_encode($table_arr));
}else {
if(!Gateway::getClientCountByGroup(str_replace(':time_discount', '', $table_arr))) {
print_r($table_arr . '过期');
Redis::del($table_arr);
}
}
Redis::set('time_discount:info', json_encode($table_arr));
}
}