@@ -200,6 +200,8 @@ class WechatCommonService extends BaseService
case 'subscribe':
self::updateUserInfo($app, $appid, $message['FromUserName'],$wechatInfoId, true);
return WechatSubscribeService::getContent($wechatInfoId);
+ case 'CLICK':
+ return WechatMenuService::getClickInfoContent($wechatInfoId,$message['EventKey']);
default:
return '收到其它消息';
}
@@ -351,4 +351,27 @@ class WechatMenuService extends BaseService
return "操作成功";
+ /**
+ * 点击事件回复
+ * name: getClickInfoContent
+ * @param $wechatInfoId
+ * date 2023/07/12 16:37
+ */
+ public static function getClickInfoContent($wechatAppId,$key)
+ {
+ $info = WechatAccountMenuDetail::query()::where([
+ 'status' => 1,
+ 'wechat_authorization_info_id' => $wechatAppId,
+ ])->first();
+ if (is_empty($info)){
+ return "";
+ }
+ $content = $info->msg_content;
+ if (empty($content)){
+ $content = getProp($content,$key);
+ return $content ?: "";
+