message = $message; } /** * Execute the job. * * @return void */ public function handle() { $log = ErrorLog::create(['message'=>$this->message, 'status'=>0]); //通知 $param = [ 'template_id' => config('wechat.tpls.error_log_notice'), // 'template_id'=>'7Tj2vYAIGaYrPd2uyQwRp98MhzTCX7SL5LV97W9jn1A', 'url' => config('app.url').'/error/logs/'.$log->id, // 'miniprogram' => [ // 'appid' => config('wechat.mini_program.app_id'), // 'pagepath' => 'pages/tabBar/serve', // ], 'data' => [ 'time2' => ['value'=>date('Y-m-d H:i:s')], 'thing4' => ['value'=>'友福健康'], ], ]; $users = ErrorUser::where('is_banned', 0)->get(); foreach ($users as $user) { $param['touser'] = $user->official_openid; SendTemplateNotice::dispatch($param)->onQueue('health'); } } }