24 lines
408 B
SQL
24 lines
408 B
SQL
-- 检查陪伴员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;
|