fix: 后端按系统时间过滤号源,避免前端时间过滤导致数据不一致
This commit is contained in:
@@ -261,7 +261,8 @@
|
||||
LEFT JOIN adm_patient pinfo ON o.patient_id = pinfo.id
|
||||
<where>
|
||||
p.delete_flag = '0'
|
||||
AND s.delete_flag = '0' <!-- 1. 按日期查 -->
|
||||
AND s.delete_flag = '0'
|
||||
<!-- 1. 按日期查 -->
|
||||
<if test="query.date != null and query.date != ''">
|
||||
AND p.schedule_date = CAST(#{query.date} AS DATE)
|
||||
</if>
|
||||
@@ -296,7 +297,9 @@
|
||||
<if test="query.phone != null and query.phone != ''">
|
||||
AND o.phone LIKE CONCAT('%', #{query.phone}, '%')
|
||||
</if>
|
||||
<!-- 5. 核心:解答您疑问的 4 种业务状态的复合查询! -->
|
||||
<!-- 5. 核心:按系统时间过滤,只返回未过期的号源 -->
|
||||
AND (p.schedule_date > CURRENT_DATE OR (p.schedule_date = CURRENT_DATE AND s.expect_time >= CAST(CURRENT_TIME AS TIME)))
|
||||
<!-- 6. 状态过滤 -->
|
||||
<if test="query.status != null and query.status != '' and query.status != 'all'">
|
||||
<choose>
|
||||
<when test="'unbooked'.equals(query.status) or '未预约'.equals(query.status)">
|
||||
|
||||
Reference in New Issue
Block a user