fix 课程作业、课程报告状态
This commit is contained in:
parent
571b135957
commit
742380e223
@ -227,14 +227,8 @@ class SubjectHomeworkController extends Crud
|
|||||||
'subject_file_version_url' => empty($subject_file_version_url) ? '' : json_encode($subject_file_version_url, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
|
'subject_file_version_url' => empty($subject_file_version_url) ? '' : json_encode($subject_file_version_url, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if($subject_homework->subject_report_version_is_publish){
|
|
||||||
//课程报告发布之后通知学生
|
|
||||||
(new SendMsgCronJobService())->uploadSubjectReportVersionNotifyStudentParents($subject_homework->id);
|
|
||||||
}
|
|
||||||
if($subject_homework->homework_file_is_publish){
|
|
||||||
//课程作业发布之后通知学生
|
|
||||||
(new SendMsgCronJobService())->uploadVersionSubjectHomeworkNotifyStudent($subject_homework->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return json([
|
return json([
|
||||||
@ -298,4 +292,51 @@ class SubjectHomeworkController extends Crud
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @desc 更改发布状态
|
||||||
|
* @param Request $request
|
||||||
|
* @return Response
|
||||||
|
*/
|
||||||
|
public function changeHomeworkFilePublishStatus(Request $request)
|
||||||
|
{
|
||||||
|
$subject_homework = \app\common\model\SubjectHomework::where('id', $request->post('id'))->findOrEmpty();
|
||||||
|
$subject_homework->save([
|
||||||
|
'homework_file_is_publish' => $request->post('homework_file_is_publish')
|
||||||
|
]);
|
||||||
|
if($subject_homework->homework_file_is_publish){
|
||||||
|
//课程作业发布之后通知学生
|
||||||
|
(new SendMsgCronJobService())->uploadVersionSubjectHomeworkNotifyStudent($subject_homework->id);
|
||||||
|
}
|
||||||
|
return json([
|
||||||
|
'code' => ResponseCode::WEB_API_SUCCESS,
|
||||||
|
'msg' => 'success'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @desc 更改发布状态
|
||||||
|
* @param Request $request
|
||||||
|
* @return Response
|
||||||
|
*/
|
||||||
|
public function changeSubjectReportPublishStatus(Request $request)
|
||||||
|
{
|
||||||
|
$subject_homework = \app\common\model\SubjectHomework::where('id', $request->post('id'))->findOrEmpty();
|
||||||
|
$subject_homework->save([
|
||||||
|
'subject_report_version_is_publish' => $request->post('subject_report_version_is_publish')
|
||||||
|
]);
|
||||||
|
if($subject_homework->subject_report_version_is_publish){
|
||||||
|
//课程报告发布之后通知学生
|
||||||
|
(new SendMsgCronJobService())->uploadSubjectReportVersionNotifyStudentParents($subject_homework->id);
|
||||||
|
}
|
||||||
|
return json([
|
||||||
|
'code' => ResponseCode::WEB_API_SUCCESS,
|
||||||
|
'msg' => 'success'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -689,6 +689,24 @@
|
|||||||
layui.form.render();
|
layui.form.render();
|
||||||
layui.form.on("switch(homework_file_is_publish)", function (data) {
|
layui.form.on("switch(homework_file_is_publish)", function (data) {
|
||||||
layui.$('input[name="homework_file_is_publish"]').val(this.checked ? 1 : 0);
|
layui.$('input[name="homework_file_is_publish"]').val(this.checked ? 1 : 0);
|
||||||
|
|
||||||
|
let id = layui.url().search[PRIMARY_KEY];
|
||||||
|
|
||||||
|
layui.$.ajax({
|
||||||
|
url: '/app/admin/subject-homework/changeHomeworkFilePublishStatus',
|
||||||
|
type: "POST",
|
||||||
|
dateType: "json",
|
||||||
|
data: {id:id, homework_file_is_publish:this.checked ? 1 : 0},
|
||||||
|
success: function (res) {
|
||||||
|
if (res.code) {
|
||||||
|
return layui.popup.failure(res.msg);
|
||||||
|
}
|
||||||
|
return layui.popup.success("操作成功", function () {
|
||||||
|
// parent.refreshTable();
|
||||||
|
// parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -725,6 +743,26 @@
|
|||||||
layui.form.render();
|
layui.form.render();
|
||||||
layui.form.on("switch(subject_report_version_is_publish)", function (data) {
|
layui.form.on("switch(subject_report_version_is_publish)", function (data) {
|
||||||
layui.$('input[name="subject_report_version_is_publish"]').val(this.checked ? 1 : 0);
|
layui.$('input[name="subject_report_version_is_publish"]').val(this.checked ? 1 : 0);
|
||||||
|
|
||||||
|
|
||||||
|
let id = layui.url().search[PRIMARY_KEY];
|
||||||
|
|
||||||
|
layui.$.ajax({
|
||||||
|
url: '/app/admin/subject-homework/changeSubjectReportPublishStatus',
|
||||||
|
type: "POST",
|
||||||
|
dateType: "json",
|
||||||
|
data: {id:id, subject_report_version_is_publish:this.checked ? 1 : 0},
|
||||||
|
success: function (res) {
|
||||||
|
if (res.code) {
|
||||||
|
return layui.popup.failure(res.msg);
|
||||||
|
}
|
||||||
|
return layui.popup.success("操作成功", function () {
|
||||||
|
// parent.refreshTable();
|
||||||
|
// parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
// 字段 是否发布 is_publish
|
// 字段 是否发布 is_publish
|
||||||
|
Loading…
x
Reference in New Issue
Block a user