This commit is contained in:
2025-10-22 16:01:39 +08:00
parent 7b10eb33e4
commit 35b32ee4dc
5 changed files with 54 additions and 8 deletions

View File

@@ -54,7 +54,14 @@ class Cashier extends Base
`table_code`='{$message['table_code']}' `table_code`='{$message['table_code']}'
"); ");
} }
// 限时折扣
$redis_str = Base::get_shopping_save_uid($message['shop_id'], $message['table_code']) . ':time_discount';
$time_dis_info = Redis::get($redis_str);
if($time_dis_info) {
$time_dis_info = json_decode($time_dis_info, true);
}else {
$time_dis_info = null;
}
$snd_data = [ $snd_data = [
'msg' => '收银机初始化', 'msg' => '收银机初始化',
'type' => 'cashier', 'type' => 'cashier',
@@ -63,7 +70,8 @@ class Cashier extends Base
'status' => 1, 'status' => 1,
'msg_id' => $rand, 'msg_id' => $rand,
'table_code' => $message['table_code'], 'table_code' => $message['table_code'],
'data' => $car 'data' => $car,
'time_dis_info' => $time_dis_info,
]; ];
self::gateway_query('sendToClient', [$client_id, json_encode($snd_data)]); self::gateway_query('sendToClient', [$client_id, json_encode($snd_data)]);

View File

@@ -4,6 +4,7 @@ namespace extend\workermans\model;
use ba\Exception; use ba\Exception;
use ba\Random; use ba\Random;
use support\Redis;
use support\think\Db; use support\think\Db;
use GatewayWorker\Lib\Gateway; use GatewayWorker\Lib\Gateway;
use think\facade\Log; use think\facade\Log;
@@ -42,13 +43,21 @@ class Manage extends Base
`table_code`= '{$message['table_code']}' `table_code`= '{$message['table_code']}'
"); ");
} }
// 限时折扣
$redis_str = Base::get_shopping_save_uid($message['shop_id'], $message['table_code']) . ':time_discount';
$time_dis_info = Redis::get($redis_str);
if($time_dis_info) {
$time_dis_info = json_decode($time_dis_info, true);
}else {
$time_dis_info = null;
}
$snd_data = [ $snd_data = [
'msg' => '管理端代客下单初始化', 'msg' => '管理端代客下单初始化',
'operate_type' => 'manage_init', 'operate_type' => 'manage_init',
'msg_id' => $rand, 'msg_id' => $rand,
'table_code' => $message['table_code'], 'table_code' => $message['table_code'],
'data' => $car 'data' => $car,
'time_dis_info' => $time_dis_info,
]; ];
self::gateway_query('sendToClient', [$client_id, json_encode($snd_data)]); self::gateway_query('sendToClient', [$client_id, json_encode($snd_data)]);
break; break;

View File

@@ -4,6 +4,7 @@ namespace extend\workermans\model;
use ba\Exception; use ba\Exception;
use ba\Random; use ba\Random;
use support\Redis;
use support\think\Db; use support\think\Db;
use GatewayWorker\Lib\Gateway; use GatewayWorker\Lib\Gateway;
use support\Log; use support\Log;
@@ -43,12 +44,21 @@ class Onboc extends Base
`table_code`= '{$message['table_code']}' `table_code`= '{$message['table_code']}'
"); ");
} }
// 限时折扣
$redis_str = Base::get_shopping_save_uid($message['shop_id'], $message['table_code']) . ':time_discount';
$time_dis_info = Redis::get($redis_str);
if($time_dis_info) {
$time_dis_info = json_decode($time_dis_info, true);
}else {
$time_dis_info = null;
}
$snd_data = [ $snd_data = [
'msg' => '代客下单初始化', 'msg' => '代客下单初始化',
'operate_type' => 'onboc_init', 'operate_type' => 'onboc_init',
'msg_id' => $rand, 'msg_id' => $rand,
'table_code' => $message['table_code'], 'table_code' => $message['table_code'],
'data' => $car 'data' => $car,
'time_dis_info' => $time_dis_info,
]; ];
self::gateway_query('sendToClient', [$client_id, json_encode($snd_data)]); self::gateway_query('sendToClient', [$client_id, json_encode($snd_data)]);
break; break;

View File

@@ -4,6 +4,7 @@ namespace extend\workermans\model;
use ba\Exception; use ba\Exception;
use ba\Random; use ba\Random;
use support\Redis;
Use support\think\Db; Use support\think\Db;
use support\Log; use support\Log;
@@ -47,7 +48,14 @@ class Pad extends Base
`table_code`='{$message['table_code']}' `table_code`='{$message['table_code']}'
"); ");
} }
// 限时折扣
$redis_str = Base::get_shopping_save_uid($message['shop_id'], $message['table_code']) . ':time_discount';
$time_dis_info = Redis::get($redis_str);
if($time_dis_info) {
$time_dis_info = json_decode($time_dis_info, true);
}else {
$time_dis_info = null;
}
$snd_data = [ $snd_data = [
'msg' => 'pad初始化', 'msg' => 'pad初始化',
'type' => 'pad', 'type' => 'pad',
@@ -56,7 +64,8 @@ class Pad extends Base
'status' => 1, 'status' => 1,
'msg_id' => $rand, 'msg_id' => $rand,
'table_code' => $message['table_code'], 'table_code' => $message['table_code'],
'data' => $car 'data' => $car,
'time_dis_info' => $time_dis_info,
]; ];
self::gateway_query('sendToClient', [$client_id, json_encode($snd_data)]); self::gateway_query('sendToClient', [$client_id, json_encode($snd_data)]);
break; break;

View File

@@ -4,6 +4,7 @@ namespace extend\workermans\model;
use Exception; use Exception;
use ba\Random; use ba\Random;
use support\Redis;
use support\think\Db; use support\think\Db;
use GatewayWorker\Lib\Gateway; use GatewayWorker\Lib\Gateway;
use support\Log; use support\Log;
@@ -65,13 +66,22 @@ class Shopping extends Base
`shop_id`={$message['shop_id']} AND `shop_id`={$message['shop_id']} AND
`table_code`='{$message['table_code']}' `table_code`='{$message['table_code']}'
"); ");
// 限时折扣
$redis_str = Base::get_shopping_save_uid($message['shop_id'], $message['table_code']) . ':time_discount';
$time_dis_info = Redis::get($redis_str);
if($time_dis_info) {
$time_dis_info = json_decode($time_dis_info, true);
}else {
$time_dis_info = null;
}
$snd_data = [ $snd_data = [
'msg' => '购物车初始化', 'msg' => '购物车初始化',
'operate_type' => 'init', 'operate_type' => 'init',
'msg_id' => $rand, 'msg_id' => $rand,
'type' => 'shopping', 'type' => 'shopping',
'table_code' => $message['table_code'], 'table_code' => $message['table_code'],
'data' => $car 'data' => $car,
'time_dis_info' => $time_dis_info,
]; ];
self::gateway_query('sendToClient', [$client_id, json_encode($snd_data)]); self::gateway_query('sendToClient', [$client_id, json_encode($snd_data)]);
break; break;