fix: 批量发布学生课程消息通知

This commit is contained in:
Dai 2025-03-12 20:22:55 +08:00
parent 978cae06b9
commit 008ed9c58a

View File

@ -118,12 +118,23 @@ class StudentScheduleController extends Crud
{
try {
$data = $request->post();
$student_schedule = \app\common\model\StudentSchedule::where(['id' => $data['ids']])->select()->toArray();
$res = \app\common\model\StudentSchedule::where(['id' => $data['ids']])->save([
'is_publish' => $data['status']
]);
if (!$res) {
throw new Exception('操作失败');
}
foreach ($student_schedule as $item) {
if (!$item['is_publish'] && $data['status']) {
(new SendMsgCronJobService())->teacherScheduleTimePublishMsgToStudent($item['teacher_schedule_time_id']);
}
}
return json([
'code' => ResponseCode::WEB_API_SUCCESS,
'msg' => 'success'
@ -442,7 +453,6 @@ class StudentScheduleController extends Crud
}
$spreadsheet = new Spreadsheet();
$worksheet = $spreadsheet->getActiveSheet();
//设置工作表标题名称