本文整理匯總了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);
}