redis 加目录

This commit is contained in:
2025-12-17 13:55:47 +08:00
parent 7b5b00d90c
commit 5b3148c46a

View File

@@ -403,7 +403,7 @@ class Base extends Model
public static function saveonlinelist(array $client_id_list) public static function saveonlinelist(array $client_id_list)
{ {
if(is_array($client_id_list)) { if(is_array($client_id_list)) {
$redis_name = date('Y-m-d') . '_online_number'; $redis_name = 'online:' . date('Y-m-d') . '_online_number';
$result = Redis::get($redis_name); $result = Redis::get($redis_name);
if($result) { if($result) {
$result = json_decode($result, true); $result = json_decode($result, true);
@@ -862,7 +862,7 @@ class Base extends Model
*/ */
public static function add_total_number(string $client_id, string $type = null, $total = null) public static function add_total_number(string $client_id, string $type = null, $total = null)
{ {
$redis_name = date('Y-m-d') . '_online_number'; $redis_name = 'online:' . date('Y-m-d') . '_online_number';
$result = Redis::get($redis_name); $result = Redis::get($redis_name);
if($result) { if($result) {
$result_arr = json_decode($result, true); $result_arr = json_decode($result, true);