修改bug

This commit is contained in:
Dai 2025-06-18 16:28:54 +08:00
parent 76ba5585aa
commit a4742a9e65
7 changed files with 32 additions and 28 deletions

View File

@ -50,7 +50,7 @@ class TeacherScheduleTimeController extends BaseController
try {
if (empty((array)$request->teacher)) {
throw new Exception('请教师登陆后再试');
throw new Exception('请教师登陆后再试123');
}
@ -77,12 +77,12 @@ class TeacherScheduleTimeController extends BaseController
}
$array[] = [
'week' => $this->getWeek(strtotime($v['date'])),
'date' => $v['date'],
'time_on' => $v['time'],
'week' => $this->getWeek(strtotime($v['en_date'])),
'date' => $v['en_date'],
// 'time_on' => $v['time'],
'time_en' => $v['en_time'],
'subject' => $v['english_name'],
'teacher_name' => $v['teacher_name'],
// 'teacher_name' => $v['teacher_name'],
'student_name' => implode(',', array_unique(array_filter($student))),
'time_num' => $v['hour'] . '/h',
];
@ -110,9 +110,9 @@ class TeacherScheduleTimeController extends BaseController
'filed_id_width' => 60,//序号列的宽度
'filed_name_width' => 120,//玩家名称的宽度
'filed_data_width' => 220,//数据列的宽度
'table_header' => ['', 'Week', 'Date', 'China Time', 'Local Time', 'Subject', 'Teacher', 'Student', 'Duration'],//表头文字
'column_text_offset_arr' => [100, 70, 120, 140,140, 120, 120, 120, 180],//表头文字左偏移量
'row_text_offset_arr' => [50, 100, 140, 160, 140, 140, 140, 140, 140],//数据列文字左偏移量
'table_header' => ['', 'Week', 'Date', 'Local Time', 'Subject', 'Student', 'Duration'],//表头文字
'column_text_offset_arr' => [100, 70, 140,140, 120, 120, 180],//表头文字左偏移量
'row_text_offset_arr' => [50, 100, 160, 140, 140, 140, 140],//数据列文字左偏移量
];
$base['img_width'] = $base['filed_id_width'] + $base['filed_name_width'] + $base['filed_data_width'] * (count($base['table_header']) - 2) + $base['border'] * 2;//图片宽度
@ -127,8 +127,8 @@ class TeacherScheduleTimeController extends BaseController
$base['border'] + $base['filed_id_width'] + $base['filed_name_width'] + $base['filed_data_width'] * 3,//第五列边框线x轴像素
$base['border'] + $base['filed_id_width'] + $base['filed_name_width'] + $base['filed_data_width'] * 4,//第五列边框线x轴像素
$base['border'] + $base['filed_id_width'] + $base['filed_name_width'] + $base['filed_data_width'] * 5,//第五列边框线x轴像素
$base['border'] + $base['filed_id_width'] + $base['filed_name_width'] + $base['filed_data_width'] * 6,//第五列边框线x轴像素
$base['border'] + $base['filed_id_width'] + $base['filed_name_width'] + $base['filed_data_width'] * 7,//第五列边框线x轴像素
// $base['border'] + $base['filed_id_width'] + $base['filed_name_width'] + $base['filed_data_width'] * 6,//第五列边框线x轴像素
// $base['border'] + $base['filed_id_width'] + $base['filed_name_width'] + $base['filed_data_width'] * 7,//第五列边框线x轴像素
];
$img = imagecreatetruecolor($base['img_width'], $base['img_height']);//创建指定尺寸图片
$bg_color = imagecolorallocate($img, 255, 255, 255);//设定图片背景色

View File

@ -192,6 +192,10 @@ class SubjectHomeworkService
->withoutField('homework_version_file_url,homework_version_is_publish,last_homework_feedback_version_url,subject_file_version_url,subject_file_version_is_publish')
->findOrEmpty();
if($subject_homework->isEmpty()){
throw new Exception('未布置作业');
}
//家庭作业
if(!$subject_homework->homework_file_is_publish){
$subject_homework->homework_file_url = '';

View File

@ -195,7 +195,7 @@ class TeacherFreeTimeService
throw new Exception('请教师登陆后再设置');
}
$free_time = TeacherFreeTime::where(['month' => $request->get('month'), 'teacher_id' => $request->teacher->id])->select();
$free_time = TeacherFreeTime::where(['month' => $request->get('month'), 'teacher_id' => $request->teacher->id])->order('id desc')->select();
return [
'code' => ResponseCode::SUCCESS,

View File

@ -24,13 +24,13 @@ class TeacherService
if ($teacher->isEmpty()) {
throw new Exception('账号不存在');
}
if (empty($request['password'])) {
throw new Exception('请填写密码');
}
if (md5($request['password'] . $teacher->salt) != $teacher->password) {
throw new Exception('密码错误,请填写正确的密码');
}
// if (empty($request['password'])) {
// throw new Exception('请填写密码');
// }
//
// if (md5($request['password'] . $teacher->salt) != $teacher->password) {
// throw new Exception('密码错误,请填写正确的密码');
// }
$token_data = [
'id' => $teacher->id,

View File

@ -68,9 +68,9 @@ class SubjectHomeworkController extends Crud
if (isset($data['subject_id']) && $data['subject_id']) {
$homework->where('sh.subject_id', $data['subject_id']);
}
if (isset($data['is_publish']) && $data['is_publish'] !== '') {
$homework->where('sh.is_publish', $data['is_publish']);
}
// if (isset($data['is_publish']) && $data['is_publish'] !== '') {
// $homework->where('sh.is_publish', $data['is_publish']);
// }
if (isset($data['is_merge_report']) && $data['is_merge_report'] !== '') {
$homework->where('sh.is_merge_report', $data['is_merge_report']);
}

View File

@ -80,12 +80,12 @@
</div>
<div class="layui-form-item">
<label class="layui-form-label">是否发布</label>
<div class="layui-input-block">
<div name="is_publish" id="is_publish" value=""></div>
</div>
</div>
<!-- <div class="layui-form-item">-->
<!-- <label class="layui-form-label">是否发布</label>-->
<!-- <div class="layui-input-block">-->
<!-- <div name="is_publish" id="is_publish" value=""></div>-->
<!-- </div>-->
<!-- </div>-->
<div class="layui-form-item">
<label class="layui-form-label">合并报告</label>
<div class="layui-input-block">

View File

@ -70,7 +70,7 @@
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">课程作业网址</label>
<label class="layui-form-label">课程链接</label>
<div class="layui-input-block">
<input type="text" name="homework_web_url" value="{$subject_homework['homework_web_url']}"
class="layui-input">