fix bug
This commit is contained in:
parent
1388426e54
commit
4632ef10d4
@ -58,18 +58,22 @@ class TeacherScheduleTimeController extends BaseController
|
|||||||
$month = date('Y-m', strtotime($request_data['date']));
|
$month = date('Y-m', strtotime($request_data['date']));
|
||||||
$student_schedule = TeacherScheduleTime::where(['teacher_id' => $request->teacher->id, 'is_publish' => 1])
|
$student_schedule = TeacherScheduleTime::where(['teacher_id' => $request->teacher->id, 'is_publish' => 1])
|
||||||
->where(['month' => $month])
|
->where(['month' => $month])
|
||||||
->with(['teacher', 'subject', 'studentSchedule'])
|
->with(['teacher', 'subject', 'oneStudentSchedule'])
|
||||||
->order('start_time asc')
|
->order('start_time asc')
|
||||||
->select()->toArray();
|
->select()->toArray();
|
||||||
|
|
||||||
|
print '<pre>';
|
||||||
|
print_r($student_schedule);
|
||||||
|
die;
|
||||||
|
|
||||||
$array = [];
|
$array = [];
|
||||||
$stu_nmae = '';
|
$stu_nmae = '';
|
||||||
|
|
||||||
foreach ($student_schedule as $k => &$v) {
|
foreach ($student_schedule as $k => &$v) {
|
||||||
|
|
||||||
|
|
||||||
if ($v['studentSchedule']) {
|
if ($v['oneStudentSchedule']) {
|
||||||
foreach ($v['studentSchedule'] as $k1 => $v1) {
|
foreach ($v['oneStudentSchedule'] as $k1 => $v1) {
|
||||||
if ($v1['is_publish']) {
|
if ($v1['is_publish']) {
|
||||||
$student[] = $v1['student_name'];
|
$student[] = $v1['student_name'];
|
||||||
}
|
}
|
||||||
@ -110,7 +114,7 @@ class TeacherScheduleTimeController extends BaseController
|
|||||||
'row_hight' => 30,//每行数据行高
|
'row_hight' => 30,//每行数据行高
|
||||||
'filed_id_width' => 60,//序号列的宽度
|
'filed_id_width' => 60,//序号列的宽度
|
||||||
'filed_name_width' => 120,//玩家名称的宽度
|
'filed_name_width' => 120,//玩家名称的宽度
|
||||||
'filed_data_width' => 120,//数据列的宽度
|
'filed_data_width' => 220,//数据列的宽度
|
||||||
'table_header' => ['', 'Week', 'Date', 'Time', 'Subject', 'Teacher', 'Student', 'Duration'],//表头文字
|
'table_header' => ['', 'Week', 'Date', 'Time', 'Subject', 'Teacher', 'Student', 'Duration'],//表头文字
|
||||||
'column_text_offset_arr' => [45, 70, 70, 90, 55, 65, 65, 65],//表头文字左偏移量
|
'column_text_offset_arr' => [45, 70, 70, 90, 55, 65, 65, 65],//表头文字左偏移量
|
||||||
'row_text_offset_arr' => [50, 110, 90, 110, 90, 90, 90, 90],//数据列文字左偏移量
|
'row_text_offset_arr' => [50, 110, 90, 110, 90, 90, 90, 90],//数据列文字左偏移量
|
||||||
|
@ -53,6 +53,14 @@ class TeacherScheduleTime extends BaseModel
|
|||||||
{
|
{
|
||||||
return $this->hasMany(StudentSchedule::class, 'teacher_schedule_time_id', 'id');
|
return $this->hasMany(StudentSchedule::class, 'teacher_schedule_time_id', 'id');
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @desc 安排学生
|
||||||
|
* @return \think\model\relation\HasMany
|
||||||
|
*/
|
||||||
|
public function oneStudentSchedule()
|
||||||
|
{
|
||||||
|
return $this->hasOne(StudentSchedule::class, 'teacher_schedule_time_id', 'id');
|
||||||
|
}
|
||||||
|
|
||||||
public function studentScheduleOne1()
|
public function studentScheduleOne1()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user