本文整理汇总了PHP中app\Department::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Department::get方法的具体用法?PHP Department::get怎么用?PHP Department::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Department
的用法示例。
在下文中一共展示了Department::get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Show the application dashboard to the user.
*
* @return Response
*/
public function index()
{
$title = "Dashboard";
if (Auth::user()->role_id == 4) {
$model = Department::with(['user', 'developer', 'leader', 'manager'])->get();
return view('html.dashboard.admin', compact('title', 'model'));
} elseif (Auth::user()->role_id == 3) {
$department = Department::get();
return view('html.dashboard.manager', compact('title', 'model', 'department'));
} elseif (Auth::user()->role_id == 2) {
$list = Department::find(Auth::user()->department_id);
return view('html.dashboard.leader', compact('title', 'list'));
} else {
// if(Auth::user()->teamdetail)
// {
// $sum=0;
// foreach (Auth::user()->teamdetail as $key => $value)
// {
// foreach ($value->team->detail as $key => $item)
// {
// // var_dump(count($value->team->detail));
// foreach ($item->account->review as $key => $review) {
// # code...
// $sum+=($review->point);
// }
// }
// var_dump($sum);
// }
// exit();
// }
return view('html.dashboard.developer', compact('title'));
}
// // $leader = User::find($team->created_user_id);
}
示例2: sharing
public function sharing($id)
{
$entry = FileRecord::where('id', '=', $id)->firstOrFail();
$rawSharing = (array) json_decode($entry->sharing);
$docType = $entry->doc_type_id;
$users = User::get();
$sharedUsers = (array) $rawSharing['users'];
$departments = Department::get();
$sharedDepartments = (array) $rawSharing['departments'];
$editors = (array) json_decode($entry->user_editor);
$mass = $rawSharing['mass'];
return view('modals.sharingModal')->with('sharedUsers', $sharedUsers)->with('editors', $editors)->with('docType', $docType)->with('users', $users)->with('departments', $departments)->with('sharedDepartments', $sharedDepartments)->with('mass', $mass)->with('id', $id);
}
示例3: update
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update($id)
{
if (Request::isMethod('get')) {
$this->data['items'] = Department::get();
$this->data['lala'] = Department::find($id);
if ($this->data['lala']) {
return view('pages.department.update', $this->data);
} else {
return redirect('department');
}
} elseif (Request::isMethod('post')) {
$department = Department::find($id);
$department->update(Input::all());
return redirect('department/detail/' . $id);
}
}
示例4: editUser
public function editUser($id)
{
$user = User::where('id', $id)->firstOrFail();
$departments = Department::get();
$userTypes = UserType::get();
return view('displays.admin.editUser')->with('user', $user)->with('departments', $departments)->with('userTypes', $userTypes);
}