转桌限时折扣相关

This commit is contained in:
2025-12-23 11:04:52 +08:00
parent fcf37717e8
commit 0894132105

View File

@@ -785,9 +785,7 @@ class Base
}
$res = Db::execute($sql);
// 顺便修改限时折扣
(new static())->delTimeInfo($message);
$message['table_code'] = $message['new_table_code'];
(new static())->setTimeInfo($message);
(new static())->rottableTimeInfo($message);
Db::commit();
return $res;
}catch (Exception $e) {
@@ -964,10 +962,18 @@ class Base
}
// 限时折扣删除
public function delTimeInfo($message)
// 限时折扣换桌
public function rottableTimeInfo($message)
{
$redis_str = Base::get_shopping_time_str($message['shop_id'], $message['table_code']) . ':time_discount';
$y_time_info = Redis::get($redis_str);
if($y_time_info) {
// 保存新桌子的信息
$message['data'] = json_decode($y_time_info, true);
$message['table_code'] = $message['new_table_code'];
$this->setTimeInfo($message);
}
// 删除旧桌子的信息
Redis::del($redis_str);
$time_discount_info = Redis::get('time_discount:info');
if($time_discount_info) {