feat(admin): full integration of order, product, and finance modules with real RPC data streams
This commit is contained in:
39
docs/sql/10_schema/finance/ml_extract_v1.sql
Normal file
39
docs/sql/10_schema/finance/ml_extract_v1.sql
Normal file
@@ -0,0 +1,39 @@
|
||||
-- =====================================================================================
|
||||
-- Schema: 用户提现申请表
|
||||
-- 位置:docs/sql/10_schema/finance/
|
||||
-- 对象类型:Schema (DDL)
|
||||
-- 版本:v1
|
||||
-- 说明:管理用户发起的提现申请(佣金/余额),支持多种提现方式及快照信息
|
||||
-- =====================================================================================
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.ml_extract (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
uid UUID NOT NULL REFERENCES public.ak_users(id),
|
||||
|
||||
real_name TEXT NULL, -- 提现人姓名快照
|
||||
extract_type TEXT NOT NULL, -- 提现方式: alipay, wechat, bank
|
||||
|
||||
-- 账号快照信息
|
||||
alipay_code TEXT NULL, -- 支付宝账号
|
||||
wechat_code TEXT NULL, -- 微信账号
|
||||
bank_code TEXT NULL, -- 银行卡号
|
||||
bank_address TEXT NULL, -- 开户行地址
|
||||
|
||||
extract_price DECIMAL(12,2) NOT NULL DEFAULT 0, -- 申请提现金额
|
||||
service_fee DECIMAL(12,2) NOT NULL DEFAULT 0, -- 提现手续费
|
||||
balance DECIMAL(12,2) NOT NULL DEFAULT 0, -- 提现时的余额快照
|
||||
|
||||
status SMALLINT NOT NULL DEFAULT 0, -- 状态: 0:待审核, 1:已通过, -1:已驳回
|
||||
refusal_reason TEXT NULL, -- 驳回原因
|
||||
|
||||
admin_id UUID NULL REFERENCES public.ak_users(id), -- 审核人ID
|
||||
payment_time TIMESTAMPTZ NULL, -- 打款/到账时间
|
||||
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
-- 索引
|
||||
CREATE INDEX IF NOT EXISTS ml_extract_uid_idx ON public.ml_extract (uid);
|
||||
CREATE INDEX IF NOT EXISTS ml_extract_status_idx ON public.ml_extract (status);
|
||||
CREATE INDEX IF NOT EXISTS ml_extract_created_at_idx ON public.ml_extract (created_at DESC);
|
||||
Reference in New Issue
Block a user