本文整理汇总了PHP中Schedule::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP Schedule::insert方法的具体用法?PHP Schedule::insert怎么用?PHP Schedule::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Schedule
的用法示例。
在下文中一共展示了Schedule::insert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createSchedule
public function createSchedule()
{
$schedule = Schedule::insert();
$employees = Employee::getAllEmployees();
foreach ($employees as $employee) {
Week::insert($employee['id'], $schedule);
}
require_once 'views/home_view.php';
}
示例2: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('schedules')->delete();
$db = App::make('AccessDB');
$query = new Query('USER_OF_RUN', $db->get_dbh());
$query->order('STARTDATE');
$result = $query->get('STARTDATE,ENDDATE,USERID,NUM_OF_RUN_ID');
$result_array = [];
foreach ($result as $row) {
$result_array[] = ['start_date' => $row['STARTDATE'], 'end_date' => $row['ENDDATE'], 'employee_id' => $row['USERID'], 'weekly_schedule_id' => $row['NUM_OF_RUN_ID']];
}
$schedule = array_chunk($result_array, 1000);
foreach ($schedule as $value) {
Schedule::insert($value);
}
$convert_file = public_path() . '\\Last Convert.txt';
$record = explode(';', file_get_contents($convert_file));
$record[5] = $result[count($result) - 1]['STARTDATE'];
$file = fopen($convert_file, 'w');
fwrite($file, implode(';', $record));
fclose($file);
}