From 60a07ded50c197bf25c8a8147cd1bbf59ec01bd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Tue, 20 Jan 2026 11:44:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=BF=E9=97=B4=E8=90=A5=E4=B8=9A=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/Room.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/application/api/model/Room.php b/application/api/model/Room.php index 22b35aee..fb17f315 100644 --- a/application/api/model/Room.php +++ b/application/api/model/Room.php @@ -305,21 +305,21 @@ class Room extends Model ->where(function($query) use ($currentTime) { // 全天营业的房间(start_time和end_time都为00:00:00) $query->where(function($q) { - $q->where('start_time', '00:00:00') - ->where('end_time', '00:00:00'); + $q->where('a.start_time', '00:00:00') + ->where('a.end_time', '00:00:00'); })->whereOr(function($q) use ($currentTime) { // 正常时间限制的房间 $q->where(function($q2) use ($currentTime) { - $q2->where('start_time', '<=', $currentTime) - ->where('end_time', '>=', $currentTime) - ->where('start_time', '<=', 'end_time') - ->where('start_time', '<>', '00:00:00'); // 排除全天营业 + $q2->where('a.start_time', '<=', $currentTime) + ->where('a.end_time', '>=', $currentTime) + ->where('a.start_time', '<=', 'end_time') + ->where('a.start_time', '<>', '00:00:00'); // 排除全天营业 })->whereOr(function($q2) use ($currentTime) { // 跨天营业 - $q2->where('start_time', '>', 'end_time') + $q2->where('a.start_time', '>', 'a.end_time') ->where(function($q3) use ($currentTime) { - $q3->where('start_time', '<=', $currentTime) - ->whereOr('end_time', '>=', $currentTime); + $q3->where('a.start_time', '<=', $currentTime) + ->whereOr('a.end_time', '>=', $currentTime); }); }); });