33 lines
644 B
SQL
33 lines
644 B
SQL
-- 检查提现记录表结构和数据
|
||
-- 日期: 2026-01-31
|
||
|
||
-- 1. 查看提现记录表结构
|
||
DESC withdraw;
|
||
|
||
-- 2. 查看所有提现记录
|
||
SELECT
|
||
id,
|
||
teacher_id,
|
||
withdraw_no,
|
||
amount,
|
||
status,
|
||
account_type,
|
||
account_name,
|
||
apply_time,
|
||
approve_time,
|
||
create_time
|
||
FROM withdraw
|
||
ORDER BY create_time DESC;
|
||
|
||
-- 3. 按状态统计提现记录
|
||
SELECT
|
||
status,
|
||
COUNT(*) as count,
|
||
SUM(amount) as total_amount
|
||
FROM withdraw
|
||
WHERE deleted = 0
|
||
GROUP BY status;
|
||
|
||
-- 4. 查看某个服务商的提现记录(替换 teacher_id)
|
||
-- SELECT * FROM withdraw WHERE teacher_id = ? ORDER BY create_time DESC;
|