本文整理匯總了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'));
}