进一步完成

This commit is contained in:
2025-10-15 19:30:38 +08:00
parent c957a1ba2b
commit 348a990f88
13 changed files with 547 additions and 53 deletions

View File

@@ -4,6 +4,7 @@ namespace app\queue\redis;
use app\model\AlibabaSms;
use app\model\ShopInfo;
use support\Log;
use support\think\Db;
use Webman\RedisQueue\Consumer;
@@ -28,12 +29,17 @@ class ApplySmsTemp implements Consumer
// 查询没有提交审核的模版
$temp = Db::table('sms_shop_template')->where(['id' => $shop_template_id])->where('status', 'in', [0, -2])->find();
if($temp) {
// 处理替换内容
$templateContent_arr = ShopInfo::handleSmsTemplates($temp['content']);
$templateContent_json = json_encode($templateContent_arr);
$content = replace_placeholder_keys($temp['content'], $templateContent_arr);
// 待申请
if($temp['status'] == 0) {
$data = [
'TemplateName' => $temp['title'],
'TemplateContent' => $temp['content'],
'Remark' => !empty($temp['remark']) ? $temp['remark'] : '',
'TemplateContent' => $content,
'TemplateRule' => $templateContent_json,
'Remark' => !empty($temp['scene_detail']) ? $temp['scene_detail'] : '',
'TemplateType' => 2,
'RelatedSignName' => config('cons.sms_sign'),
];
@@ -45,7 +51,8 @@ class ApplySmsTemp implements Consumer
'TemplateCode' => $temp['template_code'],
'TemplateName' => $temp['title'],
'TemplateContent' => $temp['content'],
'Remark' => !empty($temp['remark']) ? $temp['remark'] : '',
'TemplateRule' => $templateContent_json,
'Remark' => !empty($temp['scene_detail']) ? $temp['scene_detail'] : '',
'TemplateType' => 2,
'RelatedSignName' => config('cons.sms_sign'),
];
@@ -69,6 +76,7 @@ class ApplySmsTemp implements Consumer
$update_data = [
'status' => $status,
'template_code' => $template_code,
'content_json' => $templateContent_json,
'fail_msg' => $fail_msg,
'order_id' => $order_id,
'update_time' => date('Y-m-d H:i:s'),