fix(api): 修复 TP5.0 查询构造器复用与数组入参两处系统性缺陷

1) count() 后复用同一 Query 会清空 options,导致 alias/join/where 丢失
   (SQL 报错 Unknown column/table,或筛选静默失效)
   → 基类新增 pageQuery(callable) 助手,8 个分页接口全部改用闭包重建查询
2) TP5.0 Request::input() 对不含 / 的参数名做字符串强转,值若为数组会抛
   variable type error:array(影响 media[]/benefits[]/permissions[]/icons)
   → 基类 input()/inputs() 改用 post(false)/get(false) 取原始数组
3) 种子数据:佣金调整为 settled 336.4 / 未结算 950,使可提现余额 = 186.4(与前端 mock 对齐)
4) 测试脚本:P1 必填校验断言按 分类→标题→内容 顺序修正
这个提交包含在:
linda
2026-10-15 14:56:06 +08:00
父节点 a5e63087ef
当前提交 11174f8693
共有 13 个文件被更改,包括 191 次插入 和 108 次删除

查看文件

@@ -650,17 +650,34 @@ class FcInstall extends Command
]);
}
/* ---------- 佣金(1001 的收益明细) ---------- */
Db::name('fc_commission')->insert([
'user_id' => 1001, 'from_user_id' => 1002, 'order_id' => 3002, 'order_no' => 'MO20240102002',
'order_type' => 'member', 'amount' => 33.6, 'rate' => 20, 'level' => 1, 'status' => 0,
'createtime' => $t(2),
]);
Db::name('fc_commission')->insert([
'user_id' => 1001, 'from_user_id' => 2003, 'order_id' => 3001, 'order_no' => 'PO20240101001',
'order_type' => 'post', 'amount' => 1.0, 'rate' => 20, 'level' => 1, 'status' => 1,
'settletime' => $t(1), 'createtime' => $t(3),
]);
/* ---------- 佣金(1001 的收益明细) ----------
* 数值与小程序 mock 的 distOverview 对齐:
* totalCommission 1286.4 = settled 336.4 + unsettled 950
* 已申请提现 150(auditing 50 + paid 100)
* → withdrawable = 336.4 - 150 = 186.4
*/
$commissions = [
[1002, 3002, 'MO20240102002', 'member', 900.0, 20, 1, 0, 2],
[2003, 3001, 'PO20240101001', 'post', 50.0, 20, 1, 0, 0],
[2004, 3003, 'RO20240103003', 'recharge', 1.0, 20, 1, 1, 3],
[1003, 3002, 'MO20240102002', 'member', 300.0, 10, 2, 1, 5],
[2005, 3003, 'RO20240103003', 'recharge', 35.4, 10, 2, 1, 6],
];
foreach ($commissions as $c) {
Db::name('fc_commission')->insert([
'user_id' => 1001,
'from_user_id' => $c[0],
'order_id' => $c[1],
'order_no' => $c[2],
'order_type' => $c[3],
'amount' => $c[4],
'rate' => $c[5],
'level' => $c[6],
'status' => $c[7],
'settletime' => $c[7] ? $t($c[8]) : null,
'createtime' => $t($c[8]),
]);
}
/* ---------- 提现(含待审/已打款) ---------- */
$withdraws = [