This commit is contained in:
2025-10-17 13:30:38 +08:00
parent 094b308f6e
commit 0a4b66e38c

View File

@@ -115,7 +115,6 @@ class Base extends Model
// 加入锁单分组
Gateway::joinGroup($client_id, $msg_id);
$time = time();
$redis = self::$redis;
$_SESSION[$msg_id] = $time;
//找到锁单分组中其他的人
$all = Gateway::getClientSessionsByGroup($msg_id);
@@ -127,7 +126,7 @@ class Base extends Model
$result = Redis::get($redis_name);
if($result) {
}else {
$redis->set($redis_name, $msg_id, 3600);
Redis::setEx($redis_name, 3600, $msg_id);
}
}
print_r('锁单的key-----' . $msg_id . "\r\n");
@@ -148,8 +147,6 @@ class Base extends Model
public static function payunlock(string $client_id, array $params)
{
$msg_id = self::get_shopping_save_lockname($params['shop_id'], $params['table_code']);
// 直接保存锁定
$redis = self::$redis;
// 自己先解锁
$_SESSION[$msg_id] = '';
// 找到他人并解锁
@@ -161,7 +158,7 @@ class Base extends Model
$redis_name = $g_client_id . '_lock';
$result = Redis::get($redis_name);
if($result) {
$redis->del($redis_name);
Redis::del($redis_name);
}
}
print_r('解锁的key-----' . $msg_id . "\r\n");