当前位置: 首页>>代码示例>>PHP>>正文


PHP Department::get方法代码示例

本文整理汇总了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);
 }
开发者ID:trongtri0705,项目名称:elinext_project,代码行数:39,代码来源:HomeController.php

示例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);
 }
开发者ID:LarsNorlander,项目名称:documenter,代码行数:13,代码来源:ModalController.php

示例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);
     }
 }
开发者ID:bilfash,项目名称:monstaff,代码行数:22,代码来源:DepartmentController.php

示例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);
 }
开发者ID:LarsNorlander,项目名称:documenter,代码行数:7,代码来源:AdminController.php


注:本文中的app\Department::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。