fix: 批量发布学生课程消息通知
This commit is contained in:
parent
978cae06b9
commit
008ed9c58a
@ -118,12 +118,23 @@ class StudentScheduleController extends Crud
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$data = $request->post();
|
$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([
|
$res = \app\common\model\StudentSchedule::where(['id' => $data['ids']])->save([
|
||||||
'is_publish' => $data['status']
|
'is_publish' => $data['status']
|
||||||
]);
|
]);
|
||||||
if (!$res) {
|
if (!$res) {
|
||||||
throw new Exception('操作失败');
|
throw new Exception('操作失败');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach ($student_schedule as $item) {
|
||||||
|
if (!$item['is_publish'] && $data['status']) {
|
||||||
|
(new SendMsgCronJobService())->teacherScheduleTimePublishMsgToStudent($item['teacher_schedule_time_id']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return json([
|
return json([
|
||||||
'code' => ResponseCode::WEB_API_SUCCESS,
|
'code' => ResponseCode::WEB_API_SUCCESS,
|
||||||
'msg' => 'success'
|
'msg' => 'success'
|
||||||
@ -442,7 +453,6 @@ class StudentScheduleController extends Crud
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$spreadsheet = new Spreadsheet();
|
$spreadsheet = new Spreadsheet();
|
||||||
$worksheet = $spreadsheet->getActiveSheet();
|
$worksheet = $spreadsheet->getActiveSheet();
|
||||||
//设置工作表标题名称
|
//设置工作表标题名称
|
||||||
|
Loading…
x
Reference in New Issue
Block a user