fix bug
This commit is contained in:
parent
87a3c70278
commit
7b471851e0
@ -538,18 +538,21 @@ class SendMsgCronJobService
|
|||||||
* @return array|void
|
* @return array|void
|
||||||
* @throws \GuzzleHttp\Exception\GuzzleException
|
* @throws \GuzzleHttp\Exception\GuzzleException
|
||||||
*/
|
*/
|
||||||
public function uploadVersionSubjectHomeworkNotifyStudent($student_homework_id)
|
public function uploadVersionSubjectHomeworkNotifyStudent($subject_homework_id)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$student_homework = StudentHomework::where(['id' => $student_homework_id])->with(['teacher', 'subject'])->findOrEmpty();
|
$subject_homework = SubjectHomework::where(['id'=>$subject_homework_id])->findOrEmpty();
|
||||||
// $subject_homework = SubjectHomework::where(['id' => $subject_homework_id])->with(['teacher', 'subject'])->findOrEmpty();
|
//查找该课程作业的课程的学生
|
||||||
|
$student_schedule = StudentSchedule::where(['teacher_schedule_time_id'=>$subject_homework->teacher_schedule_time_id])->with(['student', 'subject', 'teacher'])->findOrEmpty();
|
||||||
|
//
|
||||||
|
// $student_homework = StudentHomework::where(['id' => $student_homework_id])->with(['teacher', 'subject'])->findOrEmpty();
|
||||||
|
|
||||||
//查找相同老师、相同课程、相同学生的下一节课
|
//查找相同老师、相同课程、相同学生的下一节课
|
||||||
$next_student_schedule_time = StudentSchedule::where([
|
$next_student_schedule_time = StudentSchedule::where([
|
||||||
'student_id' => $student_homework->student_id,
|
'student_id' => $student_schedule->student_id,
|
||||||
'teacher_id' => $student_homework->teacher_id,
|
'teacher_id' => $student_schedule->teacher_id,
|
||||||
'subject_id' => $student_homework->subject_id
|
'subject_id' => $student_schedule->subject_id
|
||||||
])->whereTime('start_time', '>', $student_homework->start_time)
|
])->whereTime('start_time', '>', $student_schedule->start_time)
|
||||||
->order('id asc')
|
->order('id asc')
|
||||||
->limit(1)
|
->limit(1)
|
||||||
->findOrEmpty();
|
->findOrEmpty();
|
||||||
@ -558,24 +561,27 @@ class SendMsgCronJobService
|
|||||||
if (!$next_student_schedule_time->isEmpty()) {
|
if (!$next_student_schedule_time->isEmpty()) {
|
||||||
$next_time = $next_student_schedule_time->start_time;
|
$next_time = $next_student_schedule_time->start_time;
|
||||||
} else {
|
} else {
|
||||||
$next_time = '';//不能没有值
|
// $next_time = date('Y-m-d H:i:s', strtotime('+7 day',$next_student_schedule_time->start_time ));//不能没有值
|
||||||
|
$next_time = '作业提交时间为下次上课前';//不能没有值
|
||||||
}
|
}
|
||||||
if (!empty($subject_homework->homework_version_file_url)) {
|
|
||||||
|
|
||||||
|
if (!empty($subject_homework->subject_file_url)) {
|
||||||
|
|
||||||
$send_teacher_data = [
|
$send_teacher_data = [
|
||||||
'touser' => $student_homework->student_openid,
|
'touser' => $student_schedule->student_openid,
|
||||||
'template_id' => 'IYIMurENbyxkQ_axIsrkjMJNb8i1AIX4qRgVUEzQX6I',
|
'template_id' => 'IYIMurENbyxkQ_axIsrkjMJNb8i1AIX4qRgVUEzQX6I',
|
||||||
'data' => [
|
'data' => [
|
||||||
'thing1' => [//所属课程
|
'thing1' => [//所属课程
|
||||||
'value' => substr($subject_homework->english_name . '/' . date('m-d H:i', strtotime($subject_homework->start_time)), 0, 18) . '..',
|
'value' => substr($student_schedule->english_name . '/' . date('m-d H:i', strtotime($student_schedule->start_time)), 0, 18) . '..',
|
||||||
'color' => '#000000'
|
'color' => '#000000'
|
||||||
],
|
],
|
||||||
'thing2' => [//作业名称
|
'thing2' => [//作业名称
|
||||||
'value' => substr($subject_homework->english_name . '/' . date('m-d H:i', strtotime($subject_homework->start_time)), 0, 18) . '..',
|
'value' => substr($student_schedule->english_name . '/' . date('m-d H:i', strtotime($student_schedule->start_time)), 0, 18) . '..',
|
||||||
'color' => '#000000'
|
'color' => '#000000'
|
||||||
],
|
],
|
||||||
'thing3' => [//批改老师
|
'thing3' => [//批改老师
|
||||||
'value' => $subject_homework->teacher_name,
|
'value' => $student_schedule->teacher_name,
|
||||||
'color' => '#000000'
|
'color' => '#000000'
|
||||||
],
|
],
|
||||||
'time8' => [//机构名称
|
'time8' => [//机构名称
|
||||||
|
Loading…
x
Reference in New Issue
Block a user