當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Report::select方法代碼示例

本文整理匯總了PHP中Report::select方法的典型用法代碼示例。如果您正苦於以下問題:PHP Report::select方法的具體用法?PHP Report::select怎麽用?PHP Report::select使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Report的用法示例。


在下文中一共展示了Report::select方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: showReport

 public function showReport($year = NULL, $week = NULL)
 {
     $departmentId = Auth::user()->current_department;
     $users = Department::find($departmentId)->users;
     $availableReports = Report::select('year', 'week')->where('department_id', '=', $departmentId)->orderBy('year', 'desc')->orderBy('week', 'desc')->distinct()->get();
     if (!$year && !$week) {
         $week = date('W');
         $year = date('Y');
         $week_start = date('Y-m-d', strtotime($year . 'W' . $week));
         $week_end = date('Y-m-d', strtotime($week_start . '+6 days'));
         foreach ($users as &$user) {
             $user->hoursWorked = $this->getHours($departmentId, $user->id, $week, $year);
         }
         $code = NULL;
     } else {
         //if ($week < 10) $week = '0'.$week;
         $week_start = date('Y-m-d', strtotime($year . 'W' . $week));
         $week_end = date('Y-m-d', strtotime($week_start . '+6 days'));
         foreach ($users as &$user) {
             $user->hoursWorked = $this->getHoursFromReports($departmentId, $user->id, $week, $year);
         }
         $code = $year . '-' . $week;
     }
     $this->layout->content = View::make('dashboard.report')->with('title', 'Report')->with('users', $users)->with('weekStart', $week_start)->with('weekEnd', $week_end)->with('available_reports', $availableReports)->with('code', $code);
 }
開發者ID:uTosTan,項目名稱:codesamples,代碼行數:25,代碼來源:DashboardController.php

示例2: reports

 public function reports()
 {
     Auth::basic('username');
     if (!Auth::check()) {
         // do auth
         Auth::basic('username');
         if (!Auth::check()) {
             return Response::make(View::make('unauth', array()), 401)->header('WWW-Authenticate', 'Basic');
         }
     }
     Report::clearCache();
     $reports = Report::select()->with('pathRecord', 'user')->orderBy('created_at', 'desc')->paginate(30);
     return View::make('reports', array('reports' => $reports, 'pageTitle' => 'Reports'));
 }
開發者ID:qqueue,項目名稱:MangaIndex,代碼行數:14,代碼來源:ReportsController.php

示例3: report

 /**
  * Report nasty behaviour from the site
  * @return json Success
  */
 private function report()
 {
     Base::requireLogged();
     $ret = array('status' => 0);
     $attacker = $_GET['id'];
     $type = $_GET['type'];
     $properType = in_array($type, array('user', 'playlist', 'track'), 1) && ctype_lower($type);
     if (!Validate::id($attacker) || !$properType) {
         return $ret;
     }
     $attacker = (int) $attacker;
     $victim = LOGGED;
     $report = Report::select('id')->where('attacker', $attacker)->where('victim', $victim)->where('type', $type)->findOne();
     if (!$report) {
         $report = Report::create();
         $report->attacker = $attacker;
         $report->victim = $victim;
         $report->type = $type;
         $report->save();
     }
     $ret['status'] = 1;
     return $ret;
 }
開發者ID:nytr0gen,項目名稱:plur-music-explorer,代碼行數:27,代碼來源:request.php

示例4: reports

 public function reports()
 {
     Report::clearCache();
     $reports = Report::select()->with('pathRecord', 'user')->orderBy('created_at', 'desc')->paginate(30);
     return View::make('reports', array('reports' => $reports, 'pageTitle' => 'Reports'));
 }
開發者ID:Lord-Simon,項目名稱:MangaIndex,代碼行數:6,代碼來源:ReportsController.php


注:本文中的Report::select方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。