更新若干功能
Some checks failed
Tests / PHP 8.2 (push) Has been cancelled
Tests / PHP 8.3 (push) Has been cancelled
Tests / PHP 8.4 (push) Has been cancelled

This commit is contained in:
2026-08-20 19:16:49 +08:00
parent 72bc6502eb
commit 4ddf5e3c5f
48 changed files with 1908 additions and 18 deletions

View File

@@ -120,6 +120,8 @@ class WxThemeService extends BaseWxService
'card_schemes' => WxCardSchemeService::mapByCodes($this->collectSchemeCodes($layout)),
'features' => [
'package_enabled' => WxAppService::getInstance()->packageEnabled(),
'subscribe_pay_tpl' => $this->subscribeTpl('subscribe_pay_tpl'),
'subscribe_ship_tpl' => $this->subscribeTpl('subscribe_ship_tpl'),
],
'fallback' => $fallback,
];
@@ -163,4 +165,17 @@ class WxThemeService extends BaseWxService
->orderBy('sort', 'asc')
->get(['code', 'name', 'style_tag', 'preview']);
}
/**
* 当前品牌的订阅模板 ID给小程序 requestSubscribeMessage
*/
private function subscribeTpl(string $field): string
{
try {
$app = WxAppService::getInstance()->current();
return trim((string) ($app[$field] ?? ''));
} catch (\Throwable) {
return '';
}
}
}