This commit is contained in:
ASUS 2025-10-22 15:07:52 +08:00
parent 3c45d268fd
commit 3fc0d6ca97
2 changed files with 5 additions and 13 deletions

View File

@ -358,7 +358,7 @@ class Base extends Model
public static function savetimediscount() public static function savetimediscount()
{ {
$table = Redis::get('time_discount_info'); $table = Redis::get('time_discount:info');
if($table) { if($table) {
$table_arr = json_decode($table, true); $table_arr = json_decode($table, true);
foreach ($table_arr as $k => $v) { foreach ($table_arr as $k => $v) {
@ -368,7 +368,7 @@ class Base extends Model
Redis::del($v); Redis::del($v);
} }
} }
Redis::set('time_discount_info', json_encode($table_arr)); Redis::set('time_discount:info', json_encode($table_arr));
} }
} }

View File

@ -131,13 +131,13 @@ class Events
}else { }else {
$res = Redis::set($redis_str, $message['data']); $res = Redis::set($redis_str, $message['data']);
// 将桌号存入redis 以便及时删除 // 将桌号存入redis 以便及时删除
$time_discount_info = Redis::get('time_discount_info'); $time_discount_info = Redis::get('time_discount:info');
if($time_discount_info) { if($time_discount_info) {
$time_discount_info_arr = json_decode($time_discount_info, true); $time_discount_info_arr = json_decode($time_discount_info, true);
$time_discount_info_arr = array_merge($time_discount_info_arr, $redis_str); $time_discount_info_arr = array_merge($time_discount_info_arr, $redis_str);
Redis::set('time_discount_info', json_encode($time_discount_info_arr)); Redis::set('time_discount:info', json_encode($time_discount_info_arr));
}else { }else {
Redis::set('time_discount_info', json_encode($redis_str)); Redis::set('time_discount:info', json_encode($redis_str));
} }
} }
$snd_data = [ $snd_data = [
@ -164,14 +164,6 @@ class Events
return; return;
} }
} }
if(!empty($message['operate_type']) && $message['operate_type'] == 'time_discount_get') {
// 桌码
if(empty($message['table_code'])) {
Gateway::sendToClient($client_id, json_encode(['msg' => '桌码或data不能为空']));
return;
}
}
// 只在初始化的时候绑定 // 只在初始化的时候绑定
if(!empty($message['operate_type']) && $message['operate_type'] == 'init') { if(!empty($message['operate_type']) && $message['operate_type'] == 'init') {