更新若干功能
This commit is contained in:
@@ -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 '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user