pluck('id')->toArray(); if (!$user_ids) { return Command::SUCCESS; } foreach ($user_ids as $user_id) { $openid = Wechat::query()->where('user_id', $user_id)->where('type', 'mp')->value('openid'); if (!$openid) { continue; } $param = [ 'touser' => $openid, 'template_id' => config('wechat.sub_tpls.step_submit_notice'), 'page' => 'pages/user/motionRecord', 'data' => [ 'thing1' => ['value' => '今天的走路步数记得上传记录哦'], 'time2' => ['value' => date('Y-m-d')], 'thing3' => ['value' => '您的健康是我们最关心的,请注意安全运动'], ] ]; SendSubscribeMessage::dispatch($param)->onQueue('health'); // WechatService::sendSubscribeMessage($param); } return Command::SUCCESS; } }