本文整理汇总了PHP中app\Team::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Team::where方法的具体用法?PHP Team::where怎么用?PHP Team::where使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Team
的用法示例。
在下文中一共展示了Team::where方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: franchise
public function franchise($franchiseID)
{
$teams = Team::where('franchID', '=', $franchiseID)->take(999);
$franchise = Franchise::where('franchID', '=', $franchiseID)->first();
$grids = TeamsController::grids($teams);
return view('teams.franchise')->with(['name' => $franchise->franchName, 'narrowGrid' => $grids['narrowGrid'], 'grid' => $grids['grid']]);
}
示例2: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
$list = Team::where('created_user_id', Auth::user()->id)->with('detail')->get();
$title = "My Teams";
return view('html.team.index', compact('list', 'title'));
}
示例3: handle
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$this->info('[' . date('d/m/Y H:i:s') . '][FFTT:Teams] STARTING');
$club = '18270175';
$champMasculins = xml_equipe($club, 'M');
$champFeminins = xml_equipe($club, 'F');
$champOthers = xml_equipe($club, '');
Team::where('active', 1)->update(['active' => 0, 'saison' => date('Y') . '-' . (date('Y') - 1)]);
foreach ($champMasculins as $champ) {
$this->info('[' . date('d/m/Y H:i:s') . '][FFTT:Team] STARTING libequipe=' . $champ->libequipe . ' libdivision=' . $champ->libdivision);
Artisan::queue('FFTT:Team', ['type' => 'M', 'libequipe' => $champ->libequipe, 'libdivision' => $champ->libdivision, 'liendivision' => $champ->liendivision]);
$this->info('[' . date('d/m/Y H:i:s') . '][FFTT:Team] ENDING libequipe=' . $champ->libequipe . ' libdivision=' . $champ->libdivision);
}
foreach ($champFeminins as $champ) {
$this->info('[' . date('d/m/Y H:i:s') . '][FFTT:Team] STARTING libequipe=' . $champ->libequipe . ' libdivision=' . $champ->libdivision);
Artisan::queue('FFTT:Team', ['type' => 'F', 'libequipe' => $champ->libequipe, 'libdivision' => $champ->libdivision, 'liendivision' => $champ->liendivision]);
$this->info('[' . date('d/m/Y H:i:s') . '][FFTT:Team] ENDING libequipe=' . $champ->libequipe . ' libdivision=' . $champ->libdivision);
}
foreach ($champOthers as $champ) {
$this->info('[' . date('d/m/Y H:i:s') . '][FFTT:Team] STARTING libequipe=' . $champ->libequipe . ' libdivision=' . $champ->libdivision);
Artisan::queue('FFTT:Team', ['type' => '', 'libequipe' => $champ->libequipe, 'libdivision' => $champ->libdivision, 'liendivision' => $champ->liendivision]);
$this->info('[' . date('d/m/Y H:i:s') . '][FFTT:Team] ENDING libequipe=' . $champ->libequipe . ' libdivision=' . $champ->libdivision);
}
$this->info('[' . date('d/m/Y H:i:s') . '][FFTT:Teams] ENDING');
}
示例4: handle
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$type = $this->argument('type');
$libequipe = $this->argument('libequipe');
$libdivision = $this->argument('libdivision');
$liendivision = $this->argument('liendivision');
if (is_array($libequipe)) {
$libequipe = $libequipe[0];
}
if (is_array($libdivision)) {
$libdivision = $libdivision[0];
}
if (is_array($liendivision)) {
$liendivision = $liendivision[0];
}
$this->info('[' . date('d/m/Y H:i:s') . '][FFTT:Team] STARTING libequipe=' . $libequipe . ' libdivision=' . $libdivision);
$team = Team::where('libequipe', $libequipe)->where('libdivision', $libdivision)->where('liendivision', $liendivision)->first();
if ($team == null) {
$team = new Team();
$team->libequipe = $libequipe;
$team->libdivision = $libdivision;
$team->liendivision = $liendivision;
$team->type = $type;
$team->active = 1;
$team->Save();
} else {
$team->active = 1;
$team->Save();
}
Artisan::queue('FFTT:Ranking', ['id' => $team->id, 'liendivision' => $team->liendivision]);
Artisan::queue('FFTT:Matchs', ['id' => $team->id, 'liendivision' => $team->liendivision]);
$team->touch();
$this->info('[' . date('d/m/Y H:i:s') . '][FFTT:Team] ENDING libequipe=' . $libequipe . ' libdivision=' . $libdivision);
}
示例5: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$staff_team = '';
$leader = '';
$pie_leader = '';
$department = '';
$department = Department::leftJoin('staff', 'department.id', '=', 'staff.department_id')->join('level', 'staff.level_id', '=', 'level.id')->join('role', 'level.role_id', '=', 'role.id')->select(DB::raw('department.name as name_dep,role.name,count(*) as num'))->groupBy('department.name', 'role.name')->get()->toArray();
$num_staff = $department;
$pie = array();
foreach ($department as $value) {
$pie[$value['name_dep']][] = array($value['name'], (int) $value['num']);
}
// is Leader
if (Gate::allows('check-leader')) {
$department = Department::leftJoin('staff', 'department.id', '=', 'staff.department_id')->join('level', 'staff.level_id', '=', 'level.id')->join('role', 'level.role_id', '=', 'role.id')->select(DB::raw('department.name as name_dep,role.name,count(*) as num'))->where(['department.id' => Auth::user()->department_id, 'department.active' => 1])->groupBy('department.name', 'role.name')->get()->toArray();
$num_staff = $department;
$pie = array();
foreach ($department as $value) {
$pie[$value['name_dep']][] = array($value['name'], (int) $value['num']);
}
}
// is Developer
// if is manager / != department / yourself
// denied
if (Gate::allows('check-developer')) {
$staff = StaffTeam::where('staff_id', Auth::user()->id)->get()->first();
if (isset($staff) && !empty($staff)) {
$staff_team = StaffTeam::where('team_id', $staff->team_id)->where('staff_id', '!=', Auth::user()->id)->get();
$team = Team::where('id', $staff->team_id)->get()->first();
$leader = Staff::find($team->creator);
}
}
return view('admin.department.home', compact('pie', 'staff_team', 'leader', 'num_staff'));
}
示例6: search
public function search(Request $request)
{
$results = array();
$term = $request->get('term');
$goals = Goal::where('body', 'like', '%' . $term . '%')->orderBy('body', 'asc')->get();
$objectives = Objective::where('body', 'like', '%' . $term . '%')->orderBy('body', 'asc')->get();
$actions = Action::where('body', 'like', '%' . $term . '%')->orderBy('body', 'asc')->get();
$tasks = Task::where('body', 'like', '%' . $term . '%')->orderBy('body', 'asc')->get();
$teams = Team::where('name', 'like', '%' . $term . '%')->orderBy('name', 'asc')->get();
$departments = Department::where('name', 'like', '%' . $term . '%')->orderBy('name', 'asc')->get();
$users = User::where('name', 'like', '%' . $term . '%')->orderBy('name', 'asc')->get()->all();
foreach (User::where('email', 'like', '%' . $term . '%')->orderBy('name', 'asc')->get() as $matching_user_email) {
if (in_array($matching_user_email, $users)) {
continue;
}
$users[] = $matching_user_email;
}
$notes = Note::where('content', 'like', '%' . $term . '%')->orderBy('content', 'asc')->get();
$types = [$goals, $objectives, $actions, $tasks, $teams, $departments, $users, $notes];
foreach ($types as $type) {
foreach ($type as $result) {
$results[] = $result;
}
}
return view('search.show')->with('results', $results)->with('term', $term);
}
示例7: create
/**
* Return create tag view
*
* @return \Illuminate\View\View
*/
public function create($team, $feed_id)
{
$team = Team::where('slug', '=', $team)->with('feeds')->first();
$feed = Feed::with('tags.network')->where('id', '=', $feed_id)->first();
$networks = Network::all();
return view('admin.tags.create', ['feed' => $feed, 'team' => $team, 'networks' => $networks]);
}
示例8: publish
/**
* publishs the tracking of terms with supervisor and phirehose
*
* @return \Illuminate\View\View
*/
public function publish($team, $network_id)
{
$team = Team::where('slug', '=', $team)->first();
$network = Network::find($network_id);
$network = $network->title;
$keys = json_decode($team->{$network});
//Create GuzzleHttp client
$guzzleClient = new \GuzzleHttp\Client();
// Pass the url and the guzzle client to the XmlRpc Client
$client = new Client('http://localhost:9001/RPC2', new HttpAdapterTransport(new Guzzle6HttpAdapter($guzzleClient)));
// Generate XMLRpc and Supervisor Instances
$connector = new XmlRpc($client);
$supervisor = new Supervisor($connector);
// setup flysystem
$adapter = new Local('/etc/supervisor/conf.d/');
$filesystem = new Filesystem($adapter);
// create new supervisor files
$writer = new File($filesystem, 'test.conf');
$configuration = new Configuration();
$section = $this->generateNewProcess($keys, $team->id);
$configuration->addSection($section);
$writer->write($configuration);
// restart supervisor
$supervisor->restart();
}
示例9: index
public function index()
{
$teams = Team::where('is_open', 1)->get();
$recruitTeams = Team::where('is_open', 1)->get();
$action = 'teams';
return view('member.teams.list', compact('teams', 'recruitTeams', 'action'));
}
示例10: handle
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$team = new Team();
if ($team->where('user_id', session('login_web_59ba36addc2b2f9401580f014c7f58ea4e30989d'))->first()) {
return new RedirectResponse(url('add_player_in_team'));
}
return $next($request);
}
示例11: store
public function store(Request $request)
{
$team = new Team();
if ($request->team_name == '' || strlen($request->team_name) < 5) {
return TeamController::index('Komandos vardas per trumpas.');
} elseif ($team->where('team_name', $request->team_name)->first()) {
return TeamController::index('Toks vardas jau egzistuoja.');
} elseif ($team->where('user_id', $request->user()->id)->first()) {
return TeamController::index('Jūs jau turite komandą.');
} else {
$team->team_name = $request->team_name;
//$team->user_id = $request->session()->get('login_web_59ba36addc2b2f9401580f014c7f58ea4e30989d');
$team->user_id = $request->user()->id;
$team->save();
return new RedirectResponse(url('add_player_in_team'));
}
}
示例12: store
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$staff_id = (int) $request->staffId;
$staff = Staff::find($staff_id);
// is Leader
// if is manager / != department / yourself
// denied
if (Gate::allows('check-leader')) {
if ($staff->level->role->name == 'Manager' || $staff->department_id != Auth::user()->department_id || $staff->id == Auth::user()->id) {
return redirect()->route('admin.staff.index')->with('message', 'Access is denied');
}
}
// is Manager
if (Gate::allows('check-manager')) {
if ($staff->level->role->name == 'Manager') {
return redirect()->route('admin.staff.index')->with('message', 'Access is denied');
}
}
// is Developer
// if is manager / != department / yourself
// denied
if (Gate::allows('check-developer')) {
if ($staff->level->role->name == 'Manager' || $staff->department_id != Auth::user()->department_id || $staff->id == Auth::user()->id) {
return redirect()->route('admin.department.index');
}
// if != leader of team
$staff_team = StaffTeam::where('staff_id', Auth::user()->id)->get()->first();
if (!empty($staff_team)) {
$team = Team::where('id', $staff_team->team_id)->get()->first();
if ($staff->level->role->name == 'TeamLeader' && $staff->id != $team->creator) {
return redirect()->route('admin.department.index');
}
} else {
return redirect()->route('admin.department.index');
}
}
$this->validate($request, ['point' => 'required|numeric', 'review' => 'required', 'staffId' => 'required|numeric', 'rActive' => 'required|numeric']);
$review = ReView::where(['reviewer_id' => Auth::user()->id, 'staff_id' => $staff_id])->get()->first();
// review less than 30 days!
// denied
if (isset($review) && !empty($review)) {
$time = strtotime($review->created_at);
$curtime = time();
if ($curtime - $time < 3600 * 24 * 30) {
return redirect()->route('admin.department.index')->with('message', 'less than 30 days!');
}
}
$point = (int) $request->point;
$reviewer = Auth::user()->id;
$review = new Review();
$review->staff_id = $staff_id;
$review->reviewer_id = $reviewer;
$review->point = $point;
$review->comment = $request->review;
$review->active = $request->rActive;
$review->save();
return redirect()->route('admin.review.show', $staff_id)->with('message', 'Create review complete!');
}
示例13: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
if (Auth::user()->role_id < 2) {
return redirect()->back()->with('danger', 'You\'re not allowed to access this task.');
}
$list = Team::where('created_user_id', Auth::user()->id)->with('detail')->get();
$title = "My Teams";
return view('html.team.index', compact('list', 'title'));
}
示例14: index
public function index($name)
{
$team = new Team();
if (!$team->where('team_name', $name)->first()) {
return redirect()->back();
}
$res = $team->join('fantasy_user_players', 'fantasy_teams.team_id', '=', 'fantasy_user_players.team_id')->join('fantasy_players', 'fantasy_user_players.id', '=', 'fantasy_players.player_id')->where('team_name', $name)->get();
return view('front.test')->with('team', $res);
}
示例15: index
public function index()
{
$reqs = Requirement::orderBy('year', 'DESC')->orderBy('quarter', 'DESC')->orderBy('team_id', 'DESC')->get();
$teams = Team::where('active', true)->get();
foreach ($reqs as $key => $req) {
$req->req_for = $req->type->name;
if ($req->team_id !== null) {
$req->req_for .= ': ' . $req->team->name;
}
}
return view('requirements.list')->with(compact('reqs', 'teams'));
}