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


PHP Company::listAll方法代码示例

本文整理汇总了PHP中app\Company::listAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Company::listAll方法的具体用法?PHP Company::listAll怎么用?PHP Company::listAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Company的用法示例。


在下文中一共展示了Company::listAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 public function index(Request $request)
 {
     $start_time = $request->get('start') ? date("Y-m-d", strtotime($request->get('start') . " -1 day")) : date("Y-m-d", strtotime("-1 month -1 day"));
     $end_time = $request->get('end') ? date("Y-m-d", strtotime($request->get('end') . " +1 day")) : date("Y-m-d", strtotime("+1 day"));
     if (Auth::user()->role == "supadmin") {
         $company_id = $request->get('company_id');
     } else {
         $company_id = $this->company_id[0];
     }
     $currency = $company_id != null ? Company::find($company_id)->currency->title : null;
     if (Auth::user()->role == "supadmin") {
         $data = Payment::users($company_id, $start_time, $end_time);
     } else {
         $data = Payment::users($this->company_id[0], $start_time, $end_time);
     }
     return view('payment.list_users')->with(['data' => $data, 'currency' => $currency, 'companies' => Company::listAll()]);
 }
开发者ID:svetlinyotov,项目名称:Timeline_v2.0,代码行数:17,代码来源:PaymentsController.php

示例2: index

 public function index(Request $request)
 {
     if (Auth::user()->role == "supadmin") {
         $company_id = $request->get('company_id');
     } elseif (Auth::user()->role == "worker") {
         $company_id = implode(",", $this->company_id);
     } else {
         $company_id = $this->company_id[0];
     }
     $start_shift = $end_shift = "00:00";
     if ($company_id && Auth::user()->role != "worker") {
         $start_shift = Company::find($company_id)->shift_day_start;
         $end_shift = Company::find($company_id)->shift_night_start;
     }
     $companies = Company::listAll();
     $workers = Company::workers($company_id);
     return view('rosters.list')->with(['company_id' => $company_id, 'shift_start' => $start_shift, 'shift_end' => $end_shift, 'workers' => $workers, 'companies' => $companies]);
 }
开发者ID:svetlinyotov,项目名称:Timeline_v2.0,代码行数:18,代码来源:RostersController.php

示例3: edit

 public function edit($id = null)
 {
     if ($id == null) {
         $id = Auth::user()->id;
     }
     $companies = Company::listAll();
     $user = User::find($id);
     return view('users.edit')->with(['companies' => $companies, 'user' => $user]);
 }
开发者ID:svetlinyotov,项目名称:Timeline_v2.0,代码行数:9,代码来源:UsersController.php


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