微信模版消息
This commit is contained in:
@@ -24,13 +24,25 @@ class ExpiredRedis
|
||||
// __keyevent@0__:expired 表示监听0号数据库的键过期事件
|
||||
$redis->psubscribe(['__keyevent@0__:expired'], function ($pattern, $channel, $key) use($redis){
|
||||
// 例如根据键名前缀处理不同业务
|
||||
|
||||
// 营销短信
|
||||
$str = 'expired:sms:';
|
||||
if (strpos($key, $str) === 0) {
|
||||
$id = str_replace($str, '', $key);
|
||||
// 发给队列
|
||||
Redis::send('send.mark.sms', '1,' . $id);
|
||||
Log::info ("处理订单过期: {$id}\n{}");
|
||||
Log::info ("处理营销短信过期: {$id}\n{}");
|
||||
}
|
||||
// 微信模版
|
||||
$str = 'expired:wechat:';
|
||||
if (strpos($key, $str) === 0) {
|
||||
$id = str_replace($str, '', $key);
|
||||
// 发给队列
|
||||
Redis::send('send.wechat.temp', '1,' . $id);
|
||||
Log::info ("处理微信模版消息过期: {$id}\n{}");
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user