fix: 医生余号查询按schedule_date分组,避免多日期余号累加
This commit is contained in:
@@ -354,6 +354,7 @@
|
||||
SELECT
|
||||
p.doctor_id AS doctorId,
|
||||
p.doctor_name AS doctorName,
|
||||
p.schedule_date AS scheduleDate,
|
||||
COALESCE(
|
||||
SUM(
|
||||
GREATEST(
|
||||
@@ -363,6 +364,7 @@
|
||||
),
|
||||
0
|
||||
) AS available,
|
||||
COUNT(DISTINCT p.id) AS poolCount,
|
||||
CASE
|
||||
WHEN MAX(
|
||||
CASE
|
||||
@@ -407,8 +409,10 @@
|
||||
</where>
|
||||
GROUP BY
|
||||
p.doctor_id,
|
||||
p.doctor_name
|
||||
p.doctor_name,
|
||||
p.schedule_date
|
||||
ORDER BY
|
||||
p.schedule_date ASC,
|
||||
p.doctor_name ASC
|
||||
</select>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user