按天插入过期时间 每天23点30执行

This commit is contained in:
2025-10-23 14:54:24 +08:00
parent e370b69d37
commit dbb9a3dfe1
4 changed files with 45 additions and 3 deletions

View File

@@ -43,7 +43,7 @@ class SendMarkSms implements Consumer
$record = Db::table('sms_push_event')->where(['id' => $sms_push_event_id, 'status' => 0])->find();
if($record) {
// 查询是否是定时发送
if($record['send_type'] == 2 && $record['send_time'] > date('Y-m-d H:i:s')) {
if($record['send_type'] == 2 && $record['send_time'] > date('Y-m-d H:i:s') && $record['send_time'] <= date('Y-m-d 23:59:59')) {
// 推给redis
$stortime = strtotime($record['send_time']);
$a = Redis::setEx('expired:sms:'.$record['id'], $stortime - time(), 1);

View File

@@ -37,7 +37,7 @@ class SendWechatTemp implements Consumer
$record = Db::table('ac_push_event')->where(['id' => $sms_push_event_id, 'status' => 0, 'is_del' => 0])->find();
if($record) {
// 查询是否是定时发送
if($record['send_type'] == 2 && $record['send_time'] > date('Y-m-d H:i:s')) {
if($record['send_type'] == 2 && $record['send_time'] > date('Y-m-d H:i:s') && $record['send_time'] <= date('Y-m-d 23:59:59')) {
// 推给redis
$stortime = strtotime($record['send_time']);
$a = Redis::setEx('expired:wechat:'.$record['id'], $stortime - time(), 1);