argument('diet_type'); $date = date('Y-m-d'); //查看当天已定餐人员,不重复发送通知 $today_user = Restaurant::where('date', $date) ->where('status', Restaurant::STATUS_TAKE) ->where('diet_type', $diet_type) ->groupBy('user_id') ->pluck('user_id') ->toArray(); foreach ($today_user as $user_id) { $open_id = Collaborator::where('user_id', $user_id)->value('openid'); Log::info('SendEvaluateRestaurantMsg:user_id:' . $user_id . "|open_id:" . $open_id); // $open_id = 'oHGap6F1HR-5q-JdRKrgb6DwztWQ'; if (!$open_id) { continue; } //发送模板消息通知 url = /api/h5/wechat/user/auth?target_path=cateringApplyFor $params = [ 'touser' => $open_id, 'template_id' => config('wechat.tpls.evaluate_restaurant'), 'url' => config('app.url') . '/order/#/cateringApplyFor', 'data' => [ 'thing2' => ['value' => '订餐评价'], 'time6' => ['value' => $date], ] ]; SendTemplateNotice::dispatch($params)->onQueue('health'); } Log::info('SendEvaluateRestaurantMsg end'); return Command::SUCCESS; } }