Compare commits
1 Commits
main
...
feature/qi
| Author | SHA1 | Date | |
|---|---|---|---|
| 3c4f47b3fc |
@ -311,7 +311,8 @@ class AccountLedgerRemarkMap
|
||||
if ($platform === '' || $item === '') {
|
||||
continue;
|
||||
}
|
||||
$index[$platform][$item][] = $rule;
|
||||
// 平台/账单项目做大小写与空格归一:映射表里写的是「唯品会JX」,页签内部键是「唯品会jx」
|
||||
$index[$this->normalizeKey($platform)][$this->normalizeKey($item)][] = $rule;
|
||||
}
|
||||
} catch (Throwable) {
|
||||
$index = [];
|
||||
@ -323,7 +324,7 @@ class AccountLedgerRemarkMap
|
||||
/** 同平台同账单项目的「财务备注」;没有规则或财务备注为空时返回 null(由调用方回落)。 */
|
||||
private function accountMappingRemark(string $platform, string $item, array $businessRemarks, string $goodsName): ?string
|
||||
{
|
||||
$rules = $this->accountMappingIndex()[$platform][$item] ?? [];
|
||||
$rules = $this->accountMappingIndex()[$this->normalizeKey($platform)][$this->normalizeKey($item)] ?? [];
|
||||
if ($rules === []) {
|
||||
return null;
|
||||
}
|
||||
@ -346,6 +347,11 @@ class AccountLedgerRemarkMap
|
||||
return $remark === '' ? null : $remark;
|
||||
}
|
||||
|
||||
private function normalizeKey(string $value): string
|
||||
{
|
||||
return mb_strtolower(preg_replace('/\s+/u', '', $value) ?? $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 给一行账单补上 payload.ledger_remark(内部字段名 ledger_remark)。
|
||||
*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user