participants = $participants; } /** * Execute the job. * * @return void */ public function handle() { foreach ($this->participants as $participant) { $result = $this->textMessage($participant); } return; } //客服信息 public function textMessage($participant) { $app = app('wechat.official_account'); // $url = env('APP_URL')."/rp/#/redPacketFruit?official_openid=".$participant['official_openid']; $url = env('APP_URL')."/red/packet/activity/wechat/auth"; $nickname = $participant['nickname']?:'朋友'; $message = $nickname.',恭喜您!,已经获得本月领取九果红包资格,马上领取GO! 如已领取,请过滤此消息。 '; $text = new Text($message); $openId = $participant['official_openid']; $result = $app->customer_service->message($text)->to($openId)->send(); return $result; } }