页: 1 详细情况如下:
Employees | working_hours | appointment
id, name | id, day, start_time, end_time, employeeable_id, employeeable_type | id, employee_id, start_date_time, end_date_time
<><>Relation:
class Employee extends Model
{
public function workingHours()
{
return $this->morphMany(WorkingHour::class, employeeable );
}
}
class WorkingHour extends Model
{
public function employeeable()
{
return $this->morphTo();
}
}
class Appointment extends Model
{
public function employee()
{
return $this->belongsTo(Employee::class);
}
}
www.un.org/spanish/ecosoc 雇员:
[
{ day: 1, start_time: 08:00:00 , end_time: 17:00:00 },
...
{ day: 5, start_time: 08:00:00 , end_time: 17:00:00 }
]
www.un.org/spanish/ga/president
问题:
如果从May 22, 2022到June 1, 2022,到>,请提供
[
{ 2022-05-22 : [ 08:00 , 08:30 , 09:00 , ..., 17:00 ] },
{ 2022-05-23 : [ 08:00 , 08:30 , 09:30 ] } // 09:00 notice excluded.
...
{ 2022-06-01, [] }
]
如何界定上述问题? 我可以想到的是,从雇员A到每小时工作小时,如果时间不可用,则进行检查。