當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。