fix(settle): 增强 DailySettleService ext 数组保护并完善全收益终审断言

这个提交包含在:
chen
2026-09-26 14:22:43 +08:00
父节点 1c3f77dd55
当前提交 0525265074
共有 2 个文件被更改,包括 17 次插入 和 3 次删除

查看文件

@@ -110,6 +110,9 @@ class DailySettleService
foreach ($unsettledOrders as $o) {
$freshExt = \think\Db::name('shopro_order')->where('id', $o['id'])->value('ext');
$ext = is_array($freshExt) ? $freshExt : (json_decode($freshExt ?? '', true) ?: []);
if (!is_array($ext)) {
$ext = [];
}
$ext['madow_settled'] = 1;
$ext['madow_settle_time'] = time();
\think\Db::name('shopro_order')->where('id', $o['id'])->update([
@@ -149,6 +152,9 @@ class DailySettleService
foreach ($unsettledVenueOrders as $o) {
$freshExt = \think\Db::name('shopro_order')->where('id', $o['id'])->value('ext');
$ext = is_array($freshExt) ? $freshExt : (json_decode($freshExt ?? '', true) ?: []);
if (!is_array($ext)) {
$ext = [];
}
$ext['venue_settled'] = 1;
$ext['venue_settle_time'] = time();
\think\Db::name('shopro_order')->where('id', $o['id'])->update([
@@ -163,6 +169,9 @@ class DailySettleService
foreach ($allQualifiedOrders as $o) {
$freshExt = \think\Db::name('shopro_order')->where('id', $o['id'])->value('ext');
$ext = is_array($freshExt) ? $freshExt : (json_decode($freshExt ?? '', true) ?: []);
if (!is_array($ext)) {
$ext = [];
}
if (empty($ext['county_settled'])) {
$unsettledCountyOrders[] = $o;
$rules = PartnerConfig::getOrderEffectiveRules($o);
@@ -185,6 +194,9 @@ class DailySettleService
foreach ($unsettledCountyOrders as $o) {
$freshExt = \think\Db::name('shopro_order')->where('id', $o['id'])->value('ext');
$ext = is_array($freshExt) ? $freshExt : (json_decode($freshExt ?? '', true) ?: []);
if (!is_array($ext)) {
$ext = [];
}
$ext['county_settled'] = 1;
$ext['county_settle_time'] = time();
\think\Db::name('shopro_order')->where('id', $o['id'])->update([