本文整理汇总了PHP中Process::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Process::find方法的具体用法?PHP Process::find怎么用?PHP Process::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Process
的用法示例。
在下文中一共展示了Process::find方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: logout
public function logout()
{
if (Session::has('process_id')) {
$process = ProcessModel::find(Session::get('process_id'));
$process->end_time = date('H:i:s');
$process->save();
Session::forget('process_id');
}
$agent = AgentModel::find(Session::get('agent_id'));
$agent->is_active = false;
$agent->save();
Session::forget('agent_id');
return Redirect::route('agent.auth.login');
}
示例2: asyncNext
public function asyncNext()
{
$agent = AgentModel::find(Session::get('agent_id'));
$agent->is_active = true;
$agent->save();
$status = StatusModel::where('store_id', $agent->store_id)->first();
if (Session::has('process_id')) {
$process = ProcessModel::find(Session::get('process_id'));
$process->end_time = date('H:i:s');
if (Input::has('ticket_type') && Input::get('ticket_type') != '') {
$process->ticket_type = Input::get('ticket_type');
}
$process->save();
Session::forget('process_id');
}
if (Input::get('is_next') == '1') {
if ($status->current_queue_no + 1 <= $status->last_queue_no) {
$status->current_queue_no = $status->current_queue_no + 1;
$status->save();
$process = new ProcessModel();
$process->agent_id = Session::get('agent_id');
$process->queue_no = $status->current_queue_no;
$process->start_time = date('H:i:s');
$process->save();
Session::set('process_id', $process->id);
return Response::json(['result' => 'success', 'currentQueueNo' => $status->current_queue_no, 'lastQueueNo' => $status->last_queue_no, 'processId' => $process->id]);
} else {
$agent->is_active = false;
$agent->save();
return Response::json(['result' => 'failed', 'msg' => 'The queue is empty']);
}
} else {
$agent->is_active = false;
$agent->save();
return Response::json(['result' => 'failed', 'msg' => 'Your status is DEACTIVE']);
}
}
示例3: get_undo_procs
function get_undo_procs()
{
$procs = Process::find('all', array('conditions' => array(' `production_date` > 0 AND `is_done` = 0 '), 'order' => 'id desc'));
$results = array();
foreach ($procs as $proc) {
$results[] = array('name' => get_proc_name($proc->name), 'part_num' => $proc->part->num, 'part_name' => $proc->part->name, 'count' => $proc->count, 'production_date' => date('Y-m-d', strtotime($proc->production_date)), 'staffs' => get_proc_all_staffs($proc), 'check_date' => get_proc_first_work_check_date($proc));
}
return $results;
}