更新核验脚本
这个提交包含在:
@@ -122,6 +122,19 @@ function printSummary()
|
||||
echo "\n【推断】\n";
|
||||
echo " " . inferSplitPath($sc, $hf) . "\n";
|
||||
|
||||
echo "\n【汇付延时分账支付标记(delay_acct_flag)】\n";
|
||||
$delayEnable = ($sc['delay_acct_enable'] ?? '0') === '1';
|
||||
$delayAtPay = $delayEnable && (
|
||||
in_array($sc['split_mode'] ?? '', ['huifu', 'both'], true)
|
||||
|| ($sc['split_provider'] ?? 'auto') === 'huifu'
|
||||
);
|
||||
echo " delay_acct_enable(分账配置): " . ($delayEnable ? '1' : '0') . "\n";
|
||||
echo " 下单时 delay_acct_flag=Y: " . ($delayAtPay ? '是(HuifuConfig::shouldDelayAcct)' : '否') . "\n";
|
||||
if (($sc['split_enable'] ?? '0') === '1' && ($hf['miniprogram_channel'] ?? '') === 'huifu' && !$delayAtPay) {
|
||||
echo " ⚠ 小程序走汇付但支付未开延时分账:延时分账确认(acct_split_bunch)可能无法成功\n";
|
||||
echo " 建议: delay_acct_enable=1,且 split_mode=huifu/both 或 split_provider=huifu\n";
|
||||
}
|
||||
|
||||
echo "\n【代码行为说明】\n";
|
||||
echo " · 网关分账金额来自 commission/regional reward 或 split_rule\n";
|
||||
echo " · 汇付:推广员/区域 huifu_id 收 div_amt,余款进 platform_huifu_id 或主商户 huifu_id\n";
|
||||
@@ -131,7 +144,7 @@ function printSummary()
|
||||
$since = time() - 90 * 86400;
|
||||
$stats = Db::name('shopro_split_order')->alias('so')
|
||||
->join('shopro_order o', 'o.id = so.order_id')
|
||||
->where('o.paid_time', '>=', $since)
|
||||
->where('o.paytime', '>=', $since)
|
||||
->field('so.channel, so.status, COUNT(*) cnt, SUM(so.split_amount) split_sum')
|
||||
->group('so.channel, so.status')
|
||||
->select();
|
||||
@@ -175,7 +188,7 @@ function printAnomalies()
|
||||
) t GROUP BY order_id
|
||||
) wl ON wl.order_id = so.order_id
|
||||
WHERE so.status IN (2,3) AND so.split_amount > 0 AND wl.wallet_sum > 0
|
||||
AND o.paid_time >= ?
|
||||
AND o.paytime >= ?
|
||||
ORDER BY so.id DESC
|
||||
LIMIT 30
|
||||
", [$since]);
|
||||
@@ -204,7 +217,7 @@ function printAnomalies()
|
||||
|
||||
$missing = Db::name('shopro_order')->alias('o')
|
||||
->where('o.pay_type', 'huifu_wechat')
|
||||
->where('o.paid_time', '>=', $since)
|
||||
->where('o.paytime', '>=', $since)
|
||||
->whereNotExists(function ($q) {
|
||||
$q->name('shopro_split_order')->alias('so')
|
||||
->whereRaw('so.order_id = o.id')
|
||||
|
||||
在新工单中引用
屏蔽一个用户