This commit is contained in:
2025-10-22 15:02:09 +08:00
parent 355d59446f
commit 3c45d268fd
2 changed files with 77 additions and 1 deletions

View File

@@ -259,11 +259,13 @@ class Base extends Model
}
// 定时器处理消息回执/在线列表
// 定时器处理消息回执/在线列表/折扣信息
public static function geteventredis_new()
{
print_r('定时器' . "\r\n");
$gateway = Gateway::class;
// 处理折扣消息
self::savetimediscount();
// 处理消息(包含推送)
$redis_name = Gateway::getAllClientSessions();
foreach ($redis_name as $client_id => $client_id_data) {
@@ -354,6 +356,24 @@ class Base extends Model
}
public static function savetimediscount()
{
$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);
}
}
Redis::set('time_discount_info', json_encode($table_arr));
}
}
public static function saveonlinelist(array $client_id_list)
{
if(is_array($client_id_list)) {