折扣
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user