peixue-dev/Archive/[一次性]检查陪伴员待服务订单-2026-01-28.sql

24 lines
408 B
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 检查陪伴员ID为1的待服务订单status=2
SELECT
id,
order_no,
teacher_id,
student_id,
service_name,
service_date,
time_slot,
status,
create_time
FROM `order`
WHERE teacher_id = 1
AND status = 2
AND deleted = 0
ORDER BY create_time DESC;
-- 统计数量
SELECT COUNT(*) as total
FROM `order`
WHERE teacher_id = 1
AND status = 2
AND deleted = 0;