kate522
0df6e760e3
feat: full parity pass - suspend enforcement, report modal polish, wechat notify
...
- Restriction: add is_suspended/get_active_suspend; comment block now covers
suspend (小黑屋) in addition to mute, with reason in the deny message
- FrontSubmitSave::persist: block post/draft/edit submission for suspended
users (reference-theme semantics: 小黑屋 loses all publishing rights)
- report.js: close icon switched from fa-times to the SVG sprite ic-close
(#icon-close), same as reference theme; textareas gain autoHeight growth
(hidden 'other reason' box skips the first measurement)
- WeChatNotify: NOTIFY_TYPES now includes report/system so report results
and account restriction notices fan out to WeChat template messages;
generic title/description fallback for template values
- contract tests: +3 tests (suspend enforcement, modal polish, wechat types)
2026-09-20 16:09:12 +08:00
kate522
ae626ba1c8
refactor(referral): prune dead code and formalize ops list header
...
- remove unused AuthReader::invitation_mode and ReferralAttribution
helpers (get_or_create_code / validate_ref); contract test now
asserts the canonical invit_code_s reader in CreditsRuntime
- drop legacy aksrt_invite table from uninstall cleanup list
- track referral code creation time (aksrt_referral_code_created)
and surface it in the referral ops REST list
- formalize ops list headers (归属用户/推广码/启用状态/推广用户数/
有效付费用户数/创建时间) and right-align count columns
2026-09-19 12:54:22 +08:00
kate522
ca9dc7794f
refactor(pay): 流水号扩至 22 字符,移除资金流水归档方案与删单守卫
...
四件事合在一笔,因为它们落在同一批文件里——OrderRepositoryCore 与流水契约测试
同时承载号码规则与订单清理逻辑,硬拆会产生引用不通的中间提交。
1) 号码熵。{YmdHis}{6 位随机} 在同一秒内只有 10^6 的取值空间,高并发下单会因
随机后缀碰撞触发 uniq_order_number / uniq_flow_number 冲突(每秒 3 单约
2.6 天撞一次,每秒 10 单约每天 4 次)。后缀扩到 8 位后空间升至 10^8
(+6.6 bit),撞号频率下降两个数量级。
选 8 位纯数字而非等长 base36:保持定长纯数字形态,号码仍可被运营从截图或
邮件整段复制、电话口述;且表默认排序规则是 utf8mb4_*_ci(大小写不敏感),
混入大小写字母会让唯一索引把 aB 与 Ab 判为重复行,反而凭空制造冲突。22 字符
仍满足 VARCHAR(32) 与网关 out_trade_no ≤ 32,拼上重试后缀 P999 后为 26 字符。
2) 自带订单号形态校验。create() 此前对调用方传入的 order_number 不做检查,传数组
会因 (string) 转换把字面量 "Array" 写进列。现收紧为「全数字、20 或 22 位」,
不合规即弃用并回落到分配器(WP_DEBUG 下留痕)。放行 20 位是为了兼容扩位前
分配的历史号码——该方法原有的注释就声明服务于导入、补单与幂等重放。
3) 流水表补 KEY idx_flow_created (created_at)。后台「资金流水」页默认视图是
WHERE 1=1 ORDER BY created_at DESC, id DESC LIMIT n 加同条件 COUNT(*),界面
上的日期区间筛选也只有 created_at 可用。此前没有任何以 created_at 为前导列的
索引(idx_flow_event_time 的前导列是 event_type,筛选时可空),于是每次翻页
都是全表扫描 + filesort,且与表大小无关地重复付出。
4) 移除归档方案与删单守卫。归档表 + 每日清理 cron 需要配套的归档浏览入口才闭环,
未闭环时运营会误以为记录丢失;而第 3 条的索引已覆盖它要解决的主要问题,且
不必在财务表上执行 DELETE。一并撤回删单 / 清理订单时对财务记录的拦截。
- BusinessNumber:后缀位数与上界收敛为 SUFFIX_DIGITS / SUFFIX_MAX,去掉三处
重复的魔法数字;类文档写明选型依据,避免日后被改回字母方案
- OrderRepositoryCore:新增 ORDER_NUMBER_PATTERN 与 is_scalar 守卫;
clear_closed_orders 与 delete_order 恢复单路签名(去掉 $force 与
$include_orders_with_records)
- DBMigratorPart2:流水表新增 idx_flow_created,并删除两张归档表 DDL
- PayOrders:清理与删除订单回到单路处理,移除 orders_clear_blocked /
order_delete_blocked 两条提示
- 删除 FinancialFlowRetention 类与 functions.php 中的引导注册
- 测试:BusinessNumberTest 期望值改 22 字符、越界用例改 10^8、补纯数字与 P999
余量断言;流水契约测试并入索引断言、归档移除的反向断言、号码重试与形态断言
按用户要求不写双路逻辑与数据迁移。新索引依赖 dbDelta 在下次迁移时补到既有表;
若此前已跑过迁移,两张归档空表需手工 DROP(未写迁移,故不自动处理)。
验证:PHPUnit 44 项 / 106 断言全部通过;node --test(已追踪用例)333 项 /
333 通过,含本地专用用例共 370 项全部通过;php -l 全部改动的 PHP 文件通过;
残留引用扫描确认 FinancialFlowRetention、两张归档表名、has_financial_records、
count_closed_orders_with_records、financial_records_exists_sql、两条 blocked
提示、$force 与 $include_orders_with_records 均已无残留。
2026-09-18 23:17:36 +08:00
kate522
aad83072a8
refactor(pay): 统一流水号,移除订单/流水/提现三类号码前缀
...
订单号、资金流水号、提现单号此前各自带前缀配置,同一笔业务在不同界面会
呈现多个号码口径,对账与客诉排查都要先做一次前缀换算。现收敛为单一流水号
分配器,不再按业务类型区分号码形态。
- 删除 payment_order_prefix / payment_flow_prefix /
payment_withdrawal_prefix 三项配置项及其生成、校验链路
- BusinessNumber::allocate() 成为唯一入口,输出 {YmdHis}{6 位随机},
共 20 位无前缀,满足 VARCHAR(32) 与网关 out_trade_no ≤ 32 的限制
- 订单、资金流水、提现、卡密渠道交易号四处生成点全部改走该分配器
- 后台支付中心表头「订单号 / 提现单号」统一为「流水号」
- 前台用户中心与订单卡片文案同步统一;前台订单详情合并为单行流水号,
账本流水号不再下发到前台,避免同一单据出现两个对外号码
- 同步更新 financial-flow / pay-card / card-pass-order-numbers 契约测试
与 BusinessNumberTest 断言
按用户要求不做双路逻辑与数据迁移,直接替换为统一方案,历史行不做转换。
验证:node --test tests/**/*.test.cjs 362/364 通过,新增 37 项契约;失败的
2 项在改动前的干净 HEAD 基线上同样失败(基线 327 项 / 失败 2 项),分别命中
遗留的 fa fa- 标记与 FA 版本号断言,与本次改动无关。phpunit 44 项 / 103
断言全部通过;php -l 全部改动的 PHP 文件通过。
2026-09-18 22:14:27 +08:00
kate522
d2447f8aa6
fix(pay): 修复后台收款接口显示顺序不可用并接入收银台排序
...
后台「收款接口 → 收款接口显示顺序」有三处缺陷叠加:
1) sortable 渲染组件读取 item.label,而 schema 写的是 title,导致 6 行
只剩上下箭头;
2) SchemaProvider 的 sortable 分支遍历 items 定义重建数组,而该字段的
键顺序本身就是配置值,用户排序被静默改回 schema 静态顺序;
3) 真正构建收银台支付方式列表的 aksrt_list_cash_payment_methods() 使用
硬编码顺序,Gateway::get_available()/apply_sdk_order() 那套排序逻辑
无任何调用方,配置对前台毫无影响。
改为:schema 项统一使用 label(JS 与 PHP 两处对齐);sortable 持久化按
提交键顺序重建,items 定义仅作白名单;新增唯一排序实现
aksrt_sort_payment_methods()(语义对齐参考主题 zibpay_get_payment_methods
+ pay_sdk_order 键顺序),并接入内容收银台、余额充值、购买积分与会员
购买四个入口。卡密输入盒改为按渠道存在与否判断,不再假定卡密固定在末位。
清理死代码:无调用方的 Gateway::get_available/apply_sdk_order/
get_status_summary、VipServicePackages 中不可达的支付方式列表回退分支、
零引用的 settings-defaults 模块及 schema/index.js 未使用的导出、支付
sortable 的 fields 死元数据、无拖拽实现却声明的 cursor:move。
未配置 pay_sdk_order 时顺序保持不变;未写数据迁移。
验证:php -l 8 个改动文件全部通过;新增 pay-sdk-order-contract 契约测试
(6 项);node --test tests/widget-system/*.test.cjs 301 项全部通过;
后台 SPA 已重新构建。
2026-09-18 19:01:19 +08:00
kate522
db0d63b99f
fix(pay): 会员卡密单密码默认关闭,卡密盒与其他弹窗一致显示卡号+密码
...
会员购买/续费弹窗卡密盒此前仅显示卡密输入,与其他两个弹窗(卡号+密码)
不一致。根因是 pay_vip_pass_charge_only_password 的默认值偏离参考主题:
- PaymentRuntime:vip 类型 only_password 由「未设置即视为开启」改为
!empty(),与其他两类型同构(参考主题 default false)
- ChargeCard:get_public_options 的 vip 回退值 only_password true→false
- SchemaPayment + recharge.js:会员卡密单密码模式开关 default true→false
- 契约测试同步锁定默认关闭与无 isset 回退
- admin SPA 重新构建
已保存过设置且该键被持久化为开启的站点,需在后台「余额充值 → 卡密
兑换 → 会员卡密单密码模式」手动关闭一次。
2026-09-18 17:26:50 +08:00
kate522
b88eab0bfe
feat(pay): 卡密兑换入口收敛到三个购买弹窗并对齐参考主题
...
- 移除余额卡片独立「卡密兑换」通用弹窗,兑换入口分布到充值/积分/会员三个弹窗的支付方式中
- 充值弹窗补齐卡密 logo 与仅卡密时的金额选择隐藏逻辑
- 积分购买弹窗 1:1 复刻参考主题 points-pay modal(商品档位/自定义/支付方式/立即支付),REST 改为 product+custom 契约
- 会员弹窗注入卡密渠道:视图模型透传 card_pass,前端渲染卡密盒并直兑 /pay/card-pass/redeem type=vip
- 后台卡密兑换拆分为余额/积分/会员三个独立开关,VIP 段旧会员卡密组清理
- REST type 改为必填(balance/vip/credits),三类型独立闸门
- 测试重写为 card-pass-modal-redeem 契约,321 项全部通过
2026-09-18 12:25:18 +08:00
kate522
64ed47165d
fix(payment): 卡密兑换开关收敛为唯一总开关
...
- 问题:积分卡密兑换报「积分卡密兑换未开启」,因 asset_points_card_enabled
与总开关并存为双重闸门;会员卡同样存在隐藏的第二开关 pay_vip_pass_charge_s。
- 修复:ChargeCard 类型闸门统一只消费后台「余额充值 → 卡密兑换」总开关;
积分卡仅额外要求积分系统可用(系统级依赖,非独立开关)。
- 死代码清理:PaymentRuntime 删除 benefit.pass_charge/pass_charge_desc 映射;
后台 schema 删除「卡密兑换会员」独立开关组与「启用积分卡密兑换」开关(双源同步);
vip options 收敛为仅 only_password 展示配置。
- 验证:php -l 4 文件无错;契约测试 59/59 通过;容器内探针实测
credits 类型闸门放行;SPA 已重建并同步运行副本。
2026-09-17 19:18:54 +08:00
kate522
3481620ed0
feat(payment): 通用卡密兑换弹窗并修正核销订单实付与订单名称
...
- /user/balance/ 余额卡片入口改为通用「卡密兑换」弹窗:请求不带类型,
后端按卡密自动识别余额/会员/积分;卡号输入恒展示且选填
- 后台「余额充值 → 卡密充值」语义更新为「卡密兑换」,开关更名
「启用卡密兑换功能」(设置键不变),双源 schema 同步并重建 SPA
- 删除死代码:credits-vip.php 死文件、credits-balance.php 内联积分
兑换块、/pay/card-pass/options 路由与 rest_options、labels 数组、
asset_points_card_description/password_only 死字段及内联块专属 CSS
- 卡密核销订单实付恒 0:create_redeem_order 源头写 0,UserOrders
对 card_pass 订单视图层归零覆盖历史行(不迁移数据)
- 订单名称按 note.meta 生成:卡密兑换-余额充值X / 卡密兑换-积分充值X /
购入[会员档位名]X天(永久)
- 新增契约 card-pass-universal-redeem.test.cjs,收紧 user-assets-layout
契约(禁 .uc-card-pass 根类回潮)
2026-09-17 19:04:47 +08:00
kate522
ba8d4b1b90
卡密充值与兑换接入统一订单号与支付流水号
...
此前卡密核销虽已建订单,但订单号硬编码 CARD{卡ID}、渠道交易号硬编码
card_pass_{卡ID},均不受后台前缀控制;且核销产生的资金流水没有挂到
订单上(order_number 为 NULL),订单详情页的「支付流水号」恒为「—」。
ChargeCard:
- 新增 allocate_redeem_order_number():走 OrderRepository 统一分配器,
消费后台「订单前缀」(payment_order_prefix)。
- 新增 card_pass_transaction_number():BusinessNumber::candidate(flow_prefix),
消费后台「流水号前缀」(payment_flow_prefix)。
- 两条兑换路径(redeem_asset_card / redeem_vip_card)替换硬编码取号;
create_redeem_order 接收调用方传入的交易号。
- 账本重放(replayed)时回取已落库订单号,不再把本次新分配的号回给前端。
FinancialFlowService:
- record_card_pass_payment():会员卡(0 元、无账本参与)直接落一条
与订单关联、零分录的 order_payment 流水;record() 新增
allow_empty_entries 通道(prepare_entries 拒绝 delta=0,占位分录不可行)。
- record_order_event() 新增凭证结算模式:豁免「金额必须 > 0」与
「资产类订单不得记现金流水」两条门槛(卡密核销既无第三方现金流入,
订单还可能为 0 元或以积分计价)。
- attach_order_to_ledger_flow():账本提交后把流水补挂到订单上,
event_type 归一为 order_payment,使「支付流水号」可反查。
- is_successful_order_payment() 认可 card_pass 凭证结算;
is_external_recharge() 把 card_pass 与 balance/points 一并列为平台内部
结算方式,不再为卡密充值伪造现金出账分录(现金在售卡时已确认)。
关键取舍:随机订单号不得进入 LedgerCommand 的 metadata —— payload_hash
覆盖 metadata,会破坏账本幂等重放(实测撞 uniq_operation_key 后报
aksrt_ledger_idempotency_conflict),因此订单关联改在账本提交后补挂。
测试:新增 tests/admin/card-pass-order-numbers.test.cjs 钉住上述约束;
容器内三类卡密实测通过(订单号/渠道交易号/支付流水号三项均带后台前缀,
流水行分别携带 balance:in / points:in / 零分录),重放幂等恢复正常。
2026-09-17 14:15:55 +08:00
kate522
678143e7b9
feat(payment): 卡密管理改为独立页面并对齐参考主题
...
- 移除「余额充值」设置中的充值卡(card_pass_*)配置组,PHP schema 与 SPA mirror 双轨同步
- 重写后台卡密管理页:列表过滤/排序/搜索/批量删除/同款分页/点击复制、自动生成与导入、text/xls 导出
- ChargeCard 服务新增 generate_cards/rand_number/rand_password/delete_by_ids/get_export_rows,get_list 支持参考主题排序别名与标识过滤
- 删除无消费方的 /payment/charge-cards REST 路由及 batch_create/disable 死代码,数据层零迁移
2026-09-16 22:05:37 +08:00
kate522
a48007a44d
feat(payment): 支付&付费菜单按参考主题重构并新增提现策略页
...
- 子菜单重组为知识付费/余额充值/VIP会员/创作分成/推广返佣/收款接口/提现策略
- 收款接口页 1:1 复刻 Zibll 双下拉结构,仅保留支付宝/微信/PayPal/Stripe/易支付
- 订单前缀/流水号前缀/提现单号前缀配置保留并移入收款接口页
- 知识付费/推广返佣按参考主题全字段复刻,余额充值并入充值卡配置
- 新增 tabbed/between_number/page_select 表单控件及后端 pages 搜索源
- 清理旧 SPA 组件、无消费者 REST 端点与废弃配置键(不写双路兼容)
- 更新存量契约测试至新 schema 文件
2026-09-16 19:18:28 +08:00
kate522
6bbb79213b
fix(user-center): 优化提现记录弹窗分页
2026-09-16 12:53:38 +08:00
kate522
9dc278bd83
fix payment points
2026-09-04 23:35:19 +08:00
kate522
4833053a5c
fix(email): complete mail settings and templates
2026-09-04 12:06:42 +08:00
kate522
e5df6fdaa7
进行了一些小优化
2026-08-25 06:58:09 +08:00
kate522
8ddbfdd7b7
进行了一些小优化
2026-08-25 06:02:26 +08:00
kate522
75d1e6e53b
进行了一些小优化
2026-08-25 05:59:50 +08:00
kate522
07c4e969c3
新增全局流水号
2026-08-25 05:33:01 +08:00
kate522
6674bded6a
进行了一些小优化
2026-08-24 17:40:35 +08:00
kate522
85a124b886
修复支付状态问题
2026-08-24 17:21:06 +08:00
kate522
406fb8d6a6
修复两个问题
2026-08-24 16:52:26 +08:00
kate522
58f3f42bf8
修复两个问题
2026-08-24 16:38:03 +08:00
kate522
5cae5b5c93
积分与余额账务系统硬切重构
2026-08-24 15:59:11 +08:00
kate522
9375b1c30c
refactor(assets): vendor 资产迁入标准目录并全仓去除 zibll 标识
...
- assets/vendor 全量迁移: fontawesome5→assets/fontawesome5, css→assets/css,
js→assets/js/runtime(避开 14 个同名自有文件), img 合并去重→assets/img,
fonts→assets/fonts; 删除 assets/vendor
- libs 五个与 widgets/third-party 字节相同的库不重复入库, loader paths 改指向
- 运行时切换: _win.uri=assets 根, loader baseUrl=/js/runtime, enlighter 注入
路径同步; PHP 7 个引用文件切换并改名 $zibll_*→$runtime_*
- 去品牌: Qinver 头注释/品牌 console.log/演示链接清除, 默认文案中性化
- 功能标识符改名: zib__→aksrt__, zib_ajax→aksrt_ajax, window.zib→
window.aksrtLegacy, zibllblock/*→aksrtblock/*, .zib-widget→.aksrt-panel,
.zib-slider→.aksrt-slider, zib_menu_options meta 键等
- 自有 CSS 改名: legacy-utilities/compat-vars/footer shell
- admin SPA 重建; 契约测试同步(路径/断言/文件更名)
- 例外保留: tests/visual 对照环境与 fixtures 前缀(外部 Zibll 产品引用)
验证: php -l 133 个改动文件通过; runtime 86 个 JS node --check 通过;
契约测试 68/70(2 个失败经 stash 对照确认为存量问题)
2026-08-22 16:16:30 +08:00
kate522
6c6c462df8
refactor: remove forum and topic feature chains
2026-08-17 14:52:19 +08:00
kate522
566d39c3ae
fix: register referral operations for administrators
2026-08-17 14:08:32 +08:00
kate522
b501cf4611
feat: unify invite flow with referral ref
2026-08-17 13:49:59 +08:00
kate522
929603b9e2
feat: adjust affiliate commissions and withdrawal strategy
2026-08-16 23:11:01 +08:00
kate522
853114a9f9
fix: improve promotion tabs and referral layout
2026-08-16 21:28:02 +08:00
kate522
ff730ab593
feat: unify referral promotion tabs and compact earnings UI
2026-08-16 20:40:21 +08:00
kate522
8799063c6c
feat: redesign promotion earnings cards
2026-08-16 20:15:56 +08:00
kate522
698a9beb74
feat: upgrade widgets and affiliate commission flow
2026-08-16 18:29:31 +08:00
kate522
1247f9bf4e
feat(credits): exchange balance for points
...
Replace the legacy points-to-balance and external points purchase flows
with direct integer balance-to-points exchange. Enforce exchange and
points-transfer limits and capability checks across the UI and REST API.
2026-08-13 15:20:06 +08:00
kate522
ce2b266890
fix(users): keep management inside center
2026-08-12 20:59:31 +08:00
kate522
dacd0095bf
feat(users): normalize center routes and withdrawal limits
2026-08-12 19:44:47 +08:00
kate522
69dd3b66ab
fix(orders): enforce configured expiry
...
Apply the configured order lifetime to all checkout flows and close unpaid orders once their expiry is reached.
2026-08-12 17:49:54 +08:00
kate522
73216ee6e5
fix(payment): settle income at cycle boundary
2026-08-07 16:27:53 +08:00
kate522
e8e39c1ef3
fix(payment): validate creator order type
2026-08-07 13:34:57 +08:00
kate522
7cca472fe9
fix(payment): close creator income contract gaps
2026-08-07 13:30:37 +08:00
kate522
cfb0a1368c
fix(user-center): close creator income review gaps
2026-08-07 13:16:10 +08:00
kate522
c16add0807
fix(payment): normalize revenue currency filters
2026-08-07 12:53:57 +08:00
kate522
50ac2119f1
fix(payment): constrain creator income counts
2026-08-07 12:48:27 +08:00
kate522
e20418e909
feat(payment): separate creator income settlement
2026-08-07 12:39:32 +08:00
kate522 and Claude Fable 5
9e6ae32fc1
feat(payment): complete creator income center
...
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com >
2026-08-07 10:59:58 +08:00
kate522
450b9f44b9
feat: add creator income order tracking\n\nCo-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 09:15:42 +08:00
kate522 and Claude Fable 5
50236b07fa
fix(payment): refresh rebate metrics and unify withdrawal statuses
...
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com >
2026-08-06 14:06:28 +08:00
kate522 and Claude Fable 5
02fcde3c84
fix(user-center): load revenue tabs without refresh
...
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com >
2026-08-06 10:42:32 +08:00
kate522
39c92017d9
feat(user-center): merge promotion rewards into revenue
2026-08-05 23:43:16 +08:00
kate522 and Claude Fable 5
5375ad6429
perf(modal): unify cancellable frontend modal flows
...
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com >
2026-08-05 02:04:55 +08:00