Files
tyapi-server/scripts/export_combmy01_api_calls.sql
2026-06-27 23:56:18 +08:00

28 lines
875 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.

-- 导出 COMBMY01 成功调用记录(含解密密钥)
-- 用法MySQL 命令行导出 CSV:
-- mysql -h <host> -u <user> -p --default-character-set=utf8mb4 <database> < export_combmy01_api_calls.sql > combmy01_calls.csv
--
-- 或在 Navicat / DBeaver 中执行本 SQL再「导出结果为 CSV」。
-- 若 JOIN 报错表不存在,把 product 改成 products 试一下。
SELECT
ac.id,
ac.transaction_id,
ac.access_id,
ac.user_id,
p.code AS product_code,
ac.request_params,
au.secret_key,
ac.status,
ac.cost,
ac.start_at,
ac.end_at,
ac.created_at
FROM api_calls ac
INNER JOIN product p ON ac.product_id = p.id
INNER JOIN api_users au ON ac.user_id = au.user_id
WHERE ac.user_id = '2acfef92-0700-4638-b386-bd03a8ad09c3'
AND p.code = 'COMBMY01'
AND ac.status = 'success'
ORDER BY ac.created_at DESC;