上一篇文章介绍了如何生成带参数的二维码 ,https://www.cnblogs.com/lijintao1025/p/13930441.html
本次介绍下公众号不同的二维码返回不同的值
带参数的二维码扫码时微信回调时会返回 EventKey的值,用来判断来源于哪个渠道,可以根据渠道推送不同的内容
if(!empty($params[\'EventKey\']) && in_array($params[\'EventKey\'],[$keyword,$keyword1])){ \Log::info(\'WeChatChannelResponseJob:handle\',$params); $app = Factory::officialAccount(config(\'wechat.official_account.default\')); $message = new Text(\'如果已关注服务号,则弹出该二维码对应的固定文案\'); $app->customer_service->message($message)->to($params[\'FromUserName\'])->send(); $message = new Text(\'如果之前未关注服务号,则弹出关注服务号引导语+此二维码对应文案\'); $app->customer_service->message($message)->to($params[\'FromUserName\'])->send(); }