本文整理汇总了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);
}
示例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'));
}
示例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;
}
示例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'));
}