当前位置: 首页>>代码示例>>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;未经允许,请勿转载。