需求按钮状态优化

This commit is contained in:
Dev
2026-10-28 16:59:16 +08:00
parent f552fb957f
commit d47beb3f56
13 changed files with 166 additions and 43 deletions
@@ -69,11 +69,17 @@ class MessageService
//按模板字段名组装可读内容:工单号:xxx;服务项目:xxx;...;备注:xxx
$values = $msgData['values'] ?? [];
$valueNames = $template['valueNames'] ?? [];
$fields = $template['fields'] ?? [];
$lines = [];
foreach ($valueNames as $key => $name) {
if (isset($values[$key]) && $values[$key] !== '') {
$lines[] = $name . ':' . $values[$key];
if (!isset($values[$key]) || $values[$key] === '') {
continue;
}
$value = $values[$key];
if (strpos($fields[$key] ?? '', 'amount') === 0) {
$value = SubscribeMessageService::formatAmount($value);
}
$lines[] = $name . ':' . $value;
}
// 备注处理:避免正文出现两行「备注」或语义冲突
// 1) 模板字段里已含「备注」时,发送方自定义了备注文案,不再追加模板默认 remark