Merge branch 'develop'

This commit is contained in:
mzl
2025-08-14 20:08:57 +08:00
parent f4a2966b1e
commit 39e840bba8
49 changed files with 2240 additions and 522 deletions
+17 -2
View File
@@ -158,9 +158,10 @@ if (!function_exists('sendFeishuTextMessage')) {
* 替换模板
*/
if (!function_exists('replaceTpl')) {
function replaceTpl(array $data = [], string $templatePath = 'common/utils/scaffold/templates/Email.stub')
function replaceTpl(array $data = [], string $tplKey = 'email')
{
if (!$data || !$templatePath) return '';
if (!$data || !$tplKey) return '';
$templatePath = tplUrl($tplKey);
$templatePath = app_path($templatePath);
$content = file_get_contents($templatePath);
foreach ($data as $key => $value) {
@@ -170,6 +171,20 @@ if (!function_exists('replaceTpl')) {
}
}
/**
* 模板路径
*/
if (!function_exists('tplUrl')) {
function tplUrl(string $tplKey = '')
{
$urlArray = [
'email' => 'common/utils/scaffold/templates/Email.stub',
'work_order' => 'common/utils/scaffold/templates/workOrder.stub'
];
return $urlArray[$tplKey];
}
}
/**
* 替换模板
*/