with(['teacherAttr', 'subject', 'studentSchedule'])->findOrEmpty(); //给教师发送消息 $msgInfo = [ 'teacher'=>$teacher_schedule_time->teacherAttr, 'subject'=>$teacher_schedule_time->subject, ]; $msg = $send_data = [ 'touser' => '1231231', 'template_id' => 'R5kORlczAC4Ltf9RxuesUB8A0ZhEKEh0Zqv9mI8r6u4', 'data' => [ 'time2' => [//上课时间 'value' => '00:10 - 01:00', 'color' => '#000000' ], 'thing1' => [//课程名称 'value' => '历史', 'color' => '#000000' ], 'thing5' => [//上课老师 'value' => 'David', 'color' => '#000000' ], 'thing4' => [//学员姓名 'value' => '张三', 'color' => '#000000' ] ], 'miniprogram' => [ 'pagepath' => 'pages/orders/orders', 'appid' => getenv('XUN_FU_MA_MINI_APPID'), ], "lang" => "zh_CN", ]; $result = (new WechatSubscriptService())->sendMsg($msg); }catch (Exception $e){ } } }