template_id='pW9YlUaGe5-q5xQPKuaVs54FovoA4x-kEybaoKRFvK4'; // $this->template_id='8e87LapU3zQRre7s2siWNYf-qZyx5wePJvvFta1zYqc'; $this->template_id='zWSvr-xAV6eIQbqDnwiSfVAJiwwvI1tta0p4KMs0nug'; // $this->url='http://api.app.jiuweiyun.cn/api/gzh'; } /** * Handle the event. * * @param ChangeOrder $event * @return void */ public function handle(SignMessageEvent $event) { try{ $data=$event->data; $openid=$data['openid']; $config=config('wechat.official_account.default'); $app = Factory::officialAccount($config); $app->template_message->send([ 'touser' => $openid, 'template_id' => $this->template_id, "miniprogram"=>[ "appid"=>"wxcf821c17589a0ec8", "pagepath"=>"pages/sign_manage/sign_manage" ], // 'url' => $this->url, 'data' => $data['data'] ]); }catch (\Exception $exception){ Log::error('发送模板消息出错,出错内容为'.$exception); } } }