diff --git a/app/common/model/StudentHomework.php b/app/common/model/StudentHomework.php index 03c1ef3..38b2ec5 100644 --- a/app/common/model/StudentHomework.php +++ b/app/common/model/StudentHomework.php @@ -33,7 +33,8 @@ class StudentHomework extends BaseModel { return $this->hasOne(Student::class, 'id', 'student_id')->bind([ 'student_name', - 'student_account' => 'account' + 'student_account' => 'account', + 'student_openid' => 'openid', ]); } diff --git a/app/common/model/StudentSchedule.php b/app/common/model/StudentSchedule.php index 8fb6474..49d161e 100644 --- a/app/common/model/StudentSchedule.php +++ b/app/common/model/StudentSchedule.php @@ -40,7 +40,11 @@ class StudentSchedule extends BaseModel public function student() { - return $this->hasOne(Student::class, 'id', 'student_id')->bind(['student_student_name' => 'student_name', 'student_account' => 'account']); + return $this->hasOne(Student::class, 'id', 'student_id')->bind([ + 'student_student_name' => 'student_name', + 'student_account' => 'account', + 'student_openid' => 'openid', + ]); } public function subjectHomeworkArr() diff --git a/app/common/service/SendMsgCronJobService.php b/app/common/service/SendMsgCronJobService.php index 7fb98f9..e396e70 100644 --- a/app/common/service/SendMsgCronJobService.php +++ b/app/common/service/SendMsgCronJobService.php @@ -162,7 +162,7 @@ class SendMsgCronJobService foreach ($student_info as $student) { $send_teacher_data = [ - 'touser' => 'olfLh6o4CG9xb6_tA3y29shOj_Bo',//@todo:发送人 + 'touser' => $student->openid, 'template_id' => 'gTtXWz35mjbtbOZdq6uNBIqy2_W-gu7F4H6s5N-vNAI', 'data' => [ 'time2' => [//上课时间 @@ -287,7 +287,7 @@ class SendMsgCronJobService } $send_teacher_data = [ - 'touser' => 'olfLh6o4CG9xb6_tA3y29shOj_Bo',//@todo:发送人 + 'touser' => $item['teacherArr']['openid'], 'template_id' => 'yYw0jnlhjnq4AJ_CAlAghgGyV0bvbVHG-eV8TNC3REI', 'data' => [ 'thing8' => [//课程名称 @@ -413,7 +413,7 @@ class SendMsgCronJobService } $send_teacher_data = [ - 'touser' => 'olfLh6o4CG9xb6_tA3y29shOj_Bo',//@todo:发送人 + 'touser' => $teacher_schedule_time['teacherArr']['openid'], 'template_id' => 'yYw0jnlhjnq4AJ_CAlAghgGyV0bvbVHG-eV8TNC3REI', 'data' => [ 'thing8' => [//课程名称 @@ -563,7 +563,7 @@ class SendMsgCronJobService if (!empty($subject_homework->homework_version_file_url)) { $send_teacher_data = [ - 'touser' => 'olfLh6o4CG9xb6_tA3y29shOj_Bo',//@todo:发送人 + 'touser' => $student_homework->student_openid, 'template_id' => 'IYIMurENbyxkQ_axIsrkjMJNb8i1AIX4qRgVUEzQX6I', 'data' => [ 'thing1' => [//所属课程 @@ -638,7 +638,7 @@ class SendMsgCronJobService //获取教师openid $send_teacher_data = [ - 'touser' => 'olfLh6o4CG9xb6_tA3y29shOj_Bo',//@todo:发送人 + 'touser' => $student_homework->student_openid,//@todo:发送人 'template_id' => 'IYIMurENbyxkQ_axIsrkjOnfoURe4jOVpHU6zcGyksU', 'data' => [ 'thing1' => [//课程名称 @@ -720,9 +720,8 @@ class SendMsgCronJobService } - //@todo:日志 $send_teacher_data = [ - 'touser' => 'olfLh6o4CG9xb6_tA3y29shOj_Bo',//@todo:发送人 + 'touser' => $student_schedule->student_openid, 'template_id' => '9zKhl4mYHNcz2jW8MGEtfZXU2M3slaIers9-NCpY4Xc', 'data' => [ 'time3' => [//上课时间 @@ -780,7 +779,7 @@ class SendMsgCronJobService throw new Exception('未找到教师信息'); } $send_teacher_data = [ - 'touser' => 'olfLh6o4CG9xb6_tA3y29shOj_Bo',//@todo:发送人 + 'touser' => $teacher->openid,//@todo:发送人 'template_id' => 'MGAdXtRAJ7qE8hRxFu3fWZvj8bBR-oNxx-1lenpCSAI', 'data' => [ 'thing2' => [//课程名称 diff --git a/plugin/admin/app/view/student-schedule/index.html b/plugin/admin/app/view/student-schedule/index.html index 0eca91d..969194d 100644 --- a/plugin/admin/app/view/student-schedule/index.html +++ b/plugin/admin/app/view/student-schedule/index.html @@ -125,7 +125,7 @@