"/pages/video/index?video_id={$videoId}&sequence={$sequence}"]; } /** * 微信消息推送处理 * name: handleMessage * @param $app * @param $wechatAppId 微信公众号授权信息id * @param $message * @return string|void * date 2023/07/10 16:04 */ public static function handleMessage($app,$wechatAppId, $message) { switch ($message['MsgType']) { case 'event': return '收到事件消息'; break; case 'text': // 更新用户活跃时间 self::updateUserActivityTime($app,$message['FromUserName']); return self::handleTextMessage($wechatAppId,$message); break; case 'image': return '收到图片消息'; break; case 'voice': return '收到语音消息'; break; case 'video': return '收到视频消息'; break; case 'location': return '收到坐标消息'; break; case 'link': return '收到链接消息'; break; case 'file': return '收到文件消息'; default: return '收到其它消息'; break; } } /** * 文本纤细处理 * name: handleTextMessage * @param $appid * @param $content * date 2023/07/10 15:03 */ private static function handleTextMessage($wechatAppId, $msg) { $content = $msg['Content']; if ($content == "pk"){ return $msg['FromUserName'] ; } $content = WechatKeywordsService::getKeywordsByWords($content,$wechatAppId); return $content ?: ""; } private static function updateUserActivityTime($app, $openId) { $user = $app->user->get($openId); myLog("wx-xiaoxi")->info("拉取用户信息"); myLog("wx-xiaoxi")->info($user); } }