当前位置: 首页>>代码示例>>PHP>>正文


PHP Report::whereIn方法代码示例

本文整理汇总了PHP中Report::whereIn方法的典型用法代码示例。如果您正苦于以下问题:PHP Report::whereIn方法的具体用法?PHP Report::whereIn怎么用?PHP Report::whereIn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Report的用法示例。


在下文中一共展示了Report::whereIn方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 /**
  * Display a listing of reports
  *
  * @return Response
  */
 public function index()
 {
     if (!Report::canList()) {
         return $this->_access_denied();
     }
     if (Request::ajax()) {
         $users_under_me = Auth::user()->getAuthorizedUserids(Report::$show_authorize_flag);
         if (empty($users_under_me)) {
             $reports = Report::whereNotNull('reports.created_at');
         } else {
             $reports = Report::whereIn('reports.user_id', $users_under_me);
         }
         $reports = $reports->select(['reports.id', 'reports.name', 'reports.model', 'reports.path', 'reports.is_json', 'reports.id as actions']);
         return Datatables::of($reports)->edit_column('actions', function ($report) {
             $actions = [];
             $actions[] = $report->canShow() ? link_to_action('ReportsController@show', 'Show', $report->id, ['class' => 'btn btn-xs btn-primary']) : '';
             $actions[] = $report->canUpdate() ? link_to_action('ReportsController@edit', 'Update', $report->id, ['class' => 'btn btn-xs btn-default']) : '';
             $actions[] = $report->canDelete() ? Former::open(action('ReportsController@destroy', $report->id))->class('form-inline') . Former::hidden('_method', 'DELETE') . '<button type="button" class="btn btn-xs btn-danger confirm-delete">Delete</button>' . Former::close() : '';
             return implode(' ', $actions);
         })->remove_column('id')->make();
         return Datatables::of($reports)->make();
     }
     Asset::push('js', 'datatables');
     return View::make('reports.index');
 }
开发者ID:k4ml,项目名称:laravel-base,代码行数:30,代码来源:ReportsController.php

示例2: array

                $gt++;
                break;
            }
            if (count($players[0]->opponents($tournament)->where('players.id', '=', $players[$pt])->get()) == 0) {
                $games[$gt]->players = array($players[0], $players[$pt]);
                $gt++;
                unset($players[$pt]);
                unset($players[0]);
                $players = array_values($players);
                $pt = 0;
                continue;
            }
        }
        return $games;
    }
}
Round::deleting(function ($round) {
    $games = $round->games()->get();
    $gamesToDelete = array();
    foreach ($games as $game) {
        $gamesToDelete[] = $game->id;
    }
    Report::whereIn('game', $gamesToDelete)->delete();
    Game::whereIn('id', $gamesToDelete)->delete();
    $tournament = $round->tournament();
    $players = $tournament->players()->get();
    foreach ($players as $player) {
        $player->updateScore($tournament);
        $player->updateSos($tournament);
    }
});
开发者ID:romainmasc,项目名称:jackmarshall,代码行数:31,代码来源:Round.php

示例3: rawWeatherTable

 /**
  * @return \Illuminate\View\View
  * @throws Exception
  *
  */
 public function rawWeatherTable()
 {
     $title = 'Raw weather';
     $fields = Config::get('marauder.rawWeatherEntries');
     // all of the users log entries:
     $get = ['reports.id', 'reports.time'];
     /*
      * get the users cities:
      */
     $structures = Auth::user()->structures()->get();
     $cities = [];
     /** @var Structure $structure */
     foreach ($structures as $structure) {
         $city = City::findCity($structure->postal_code, $structure->country_code);
         $cities[] = $city->id;
     }
     $cities = array_unique($cities);
     $query = Report::whereIn('reports.city_id', $cities)->take(Config::get('marauder.weatherTableLimit'))->orderBy('time', 'DESC')->orderBy('reports.city_id', 'ASC');
     foreach ($fields as $field) {
         $query->withReportValue($field);
         $fieldName = str_replace('.', '_', $field);
         $get[] = $fieldName . '.value as ' . $fieldName;
     }
     $result = $query->get($get);
     if ($result->count() > 0) {
         $result = $result->toArray();
     }
     foreach ($result as $key => $entry) {
         foreach ($entry as $name => $value) {
             $result[$key][$name] = Format::format($name, $value);
         }
     }
     $ignore = [];
     return View::make('raw.table', compact('result', 'title', 'ignore'));
 }
开发者ID:JC5,项目名称:marauder,代码行数:40,代码来源:TableController.php


注:本文中的Report::whereIn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。