diff --git a/extend/workermans/model/Base.php b/extend/workermans/model/Base.php index 2f073ed..725827c 100644 --- a/extend/workermans/model/Base.php +++ b/extend/workermans/model/Base.php @@ -360,7 +360,7 @@ class Base extends Model { $table = Redis::get('time_discount:info'); if($table) { - $table_arr = json_decode($table, true); + $table_arr = explode(',', $table); if(is_array($table_arr)) { foreach ($table_arr as $k => $v) { if(!Gateway::getClientCountByGroup(str_replace(':time_discount', '', $v))) { diff --git a/plugin/webman/gateway/Events.php b/plugin/webman/gateway/Events.php index deb943b..34fc7b4 100644 --- a/plugin/webman/gateway/Events.php +++ b/plugin/webman/gateway/Events.php @@ -134,11 +134,10 @@ class Events // 将桌号存入redis 以便及时删除 $time_discount_info = Redis::get('time_discount:info'); if($time_discount_info) { - $time_discount_info_arr = json_decode($time_discount_info, true); - $time_discount_info_arr = array_merge($time_discount_info_arr, $redis_str); - Redis::set('time_discount:info', json_encode($time_discount_info_arr)); + $time_discount_info .= $redis_str . ','; + Redis::set('time_discount:info', $time_discount_info); }else { - Redis::set('time_discount:info', json_encode($redis_str)); + Redis::set('time_discount:info', $redis_str . ','); } } $snd_data = [