fix: 教师排课
This commit is contained in:
parent
3de081a51e
commit
29037ded85
@ -46,7 +46,13 @@ class StudentScheduleService
|
||||
}
|
||||
|
||||
//添加课程作业信息
|
||||
$list = $schedule_time->with(['teacher', 'subject', 'subjectHomeworkArr'])->select()->toArray();
|
||||
$list = $schedule_time->with(['teacher', 'subject', 'subjectHomeworkArr'])
|
||||
->fetchSql(true)
|
||||
->select();
|
||||
// ->toArray();
|
||||
print '<pre>';
|
||||
print_r($list);
|
||||
die;
|
||||
|
||||
return [
|
||||
'code' => ResponseCode::SUCCESS,
|
||||
|
@ -159,6 +159,25 @@ class StudentScheduleController extends Crud
|
||||
public function update(Request $request): Response
|
||||
{
|
||||
if ($request->method() === 'POST') {
|
||||
$data = $request->post();
|
||||
if(isset($data['is_publish']) && $data['is_publish'] == 1){
|
||||
$student_schedule = \app\common\model\StudentSchedule::where(['id' => $data['id']])->find();
|
||||
//查找教师课程是否发布,未发布提示先发布教师课程
|
||||
$teacher_schedule_time = TeacherScheduleTime::where(['id'=>$student_schedule['teacher_schedule_time_id']])->findOrEmpty();
|
||||
if($teacher_schedule_time->isEmpty()){
|
||||
return json([
|
||||
'code' => ResponseCode::WEB_API_FAIL,
|
||||
'msg' => '教师排课不存在'
|
||||
]);
|
||||
}
|
||||
if($teacher_schedule_time->is_publish != 1){
|
||||
return json([
|
||||
'code' => ResponseCode::WEB_API_FAIL,
|
||||
'msg' => '请先发布教师排课'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
$result = parent::update($request);
|
||||
|
||||
$data = $request->post();
|
||||
|
Loading…
x
Reference in New Issue
Block a user