This commit is contained in:
2025-10-17 15:39:51 +08:00
parent 67d912fe49
commit 70be9f3275
5 changed files with 41 additions and 12 deletions

View File

@@ -23,7 +23,7 @@ class ApplySmsTemp implements Consumer
$shop_template_id = $arr[1];
}else {
Log::info('apply.sms.temp数据格式错误');
return false;
return true;
}
try {
// 查询没有提交审核的模版
@@ -63,6 +63,7 @@ class ApplySmsTemp implements Consumer
'status' => $status,
'template_code' => $template_code,
'content_json' => $templateContent_json,
'reple_json' => json_encode($templateContent_arr),
'fail_msg' => $fail_msg,
'order_id' => $order_id,
'update_time' => date('Y-m-d H:i:s'),
@@ -89,6 +90,7 @@ class ApplySmsTemp implements Consumer
$update_data = [
'status' => $status,
'content_json' => $templateContent_json,
'reple_json' => json_encode($templateContent_arr),
'fail_msg' => $fail_msg,
'update_time' => date('Y-m-d H:i:s'),
];

View File

@@ -38,7 +38,7 @@ class BirthdayGiftSms implements Consumer
if($shop_money) {
// 余额计算
if($shop_money['money'] > $sms_price) {
$templateParam = replace_json_keys($record['template_content'], $y_temp['content_json'], $user);
$templateParam = saveJson_arr($record['template_content'], $y_temp['reple_json'], $user);
$data = [
'templateCode' => $record['template_code'],
'templateParam' => $templateParam,

View File

@@ -39,7 +39,6 @@ class SendMarkSms implements Consumer
$sms_price = $sms_price[0];
}
if($data) {
Log::info('$data');
// 发送任务
// $record = Db::table('sms_push_event')->where(['id' => $sms_push_event_id, 'push_type' => 2])->find();
$record = Db::table('sms_push_event')->where(['id' => $sms_push_event_id])->find();
@@ -48,8 +47,8 @@ class SendMarkSms implements Consumer
if($record['send_type'] == 2 && $record['send_time'] > date('Y-m-d H:i:s')) {
// 推给redis
$stortime = strtotime($record['send_time']);
Redis::setEx('expired:sms:'.$record['id'], $stortime - time(), 1);
Log::info($record . ' 定时发送已存入redis, 过期时间->>>' .$record['send_time'] . '/' . $stortime - time());
$a = Redis::setEx('expired:sms:'.$record['id'], $stortime - time(), 1);
Log::info(' 定时发送已存入redis, 过期时间->>>' .$record['send_time'] . '/' . $stortime - time() . '保存结果' . $a);
}else {
// 待发送
if($record['status'] == 0) {
@@ -82,7 +81,7 @@ class SendMarkSms implements Consumer
if($shop_money) {
// 余额计算
if($shop_money['money'] > $sms_price) {
$templateParam = replace_json_keys($record['json'], $y_temp['content_json'], $v);
$templateParam = saveJson_arr($record['json'], $y_temp['reple_json'], $v);
$data = [
'templateCode' => $y_temp['template_code'],
'templateParam' => $templateParam,