當前位置: 首頁>>代碼示例>>PHP>>正文


PHP app\Team類代碼示例

本文整理匯總了PHP中app\Team的典型用法代碼示例。如果您正苦於以下問題:PHP Team類的具體用法?PHP Team怎麽用?PHP Team使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Team類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: save

 public function save($data1, $data2)
 {
     $team = new Team();
     $team->name = $data1;
     $team->nbplayers = $data2;
     $team->save();
 }
開發者ID:vinceApp,項目名稱:Soccerteam-App,代碼行數:7,代碼來源:TeamRepository.php

示例2: 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);
 }
開發者ID:kbiyo,項目名稱:ARTTv2,代碼行數:39,代碼來源:FFTTUpdateTeam.php

示例3: 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);
 }
開發者ID:elvinas21,項目名稱:BasketballFantasyLeague,代碼行數:15,代碼來源:HaveTeam.php

示例4: 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);
 }
開發者ID:elvinas21,項目名稱:BasketballFantasyLeague,代碼行數:9,代碼來源:ViewTeamInfoController.php

示例5: boot

 public static function boot()
 {
     static::created(function ($user) {
         if (User::count() == 1) {
             $systemTeam = new Team();
             $systemTeam->name = 'System Administrators';
             $systemTeam->save();
             $user->attachTeam($systemTeam);
             $workflowTeam = new Team();
             $workflowTeam->name = 'Workflow Administrators';
             $workflowTeam->save();
             $user->attachTeam($workflowTeam);
         }
     });
 }
開發者ID:kharhys,項目名稱:revenue,代碼行數:15,代碼來源:User.php

示例6: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(Request $request)
 {
     $this->generateSessionValueIfNotExists();
     $data['teams'] = [];
     $teams = Team::orderBy('name', 'asc')->get();
     foreach ($teams as $team) {
         $isFavourite = Rating::where('session', '=', $_SESSION["session"])->where('team_id', '=', $team->id)->get();
         if (count($isFavourite) > 0) {
             $team->isFavourite = true;
         } else {
             $team->isFavourite = false;
         }
         array_push($data['teams'], $team);
     }
     //$data['ratings'] = Rating::all();
     $data['ratings'] = DB::select('select count(*) as votos, t.name as equipo, t.link as enlace, u.name as usuario
                         from ratings as r
                         join teams as t on r.team_id = t.id
                         join users as u on t.user_id = u.id
                         group by r.team_id
                         order by votos desc, t.name asc');
     //dd($data);
     $data['last_teams'] = Team::orderBy('id', 'desc')->limit(5)->get();
     $data['users'] = User::all();
     return view('welcome.welcome', $data);
 }
開發者ID:gorkaeff,項目名稱:escudosfutbol,代碼行數:31,代碼來源:WelcomeController.php

示例7: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $teams = \App\Team::all();
     foreach ($teams as $team) {
         factory(App\Player::class, 5)->create(['team_id' => $team->id]);
     }
 }
開發者ID:yeniceirl,項目名稱:lvl52a,代碼行數:12,代碼來源:PlayersTableSeeder.php

示例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();
 }
開發者ID:hillholliday,項目名稱:siphon,代碼行數:30,代碼來源:SocialController.php

示例9: team

 public function team($id)
 {
     $faker = Faker::create();
     for ($i = 1; $i <= $faker->numberBetween(24, 30); $i++) {
         Team::create(['institution_id' => $faker->numberBetween('1', count(Institution::get())), 'name' => 'Team ' . $i, 'name_altered' => 'Team ' . $i, 'robot_name' => 'Robot ' . $i, 'gender' => $faker->randomElement(['MAS', 'FEM', 'MIX']), 'challenge_id' => $id, 'degree_id' => $faker->numberBetween('1', count(Degree::get()))]);
     }
 }
開發者ID:etciberoamerica,項目名稱:robotica,代碼行數:7,代碼來源:TeamSeeder.php

示例10: index

 /**
  * Display the home page.
  *
  * @return Response
  */
 public function index()
 {
     $teamResults = Team::orderBy('team_points', 'desc')->take(10)->get();
     $matchDb = new Match();
     $match = $matchDb->join('fantasy_club as home', 'fantasy_match.home_club_id', '=', 'home.club_id')->join('fantasy_club as guest', 'fantasy_match.guest_club_id', '=', 'guest.club_id')->select('home.club_name as home_name', 'guest.club_name as guest_name', 'match_date')->get();
     return view('front.index')->with('teamResults', $teamResults)->with('j', $j = 1)->with('matches', $match);
 }
開發者ID:elvinas21,項目名稱:BasketballFantasyLeague,代碼行數:12,代碼來源:HomeController.php

示例11: create

 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     // Just return the view function.
     // If you want to add any data and pass it, just get the data and pass it as a second argument to view()
     $teams = Team::orderBy('name', 'asc')->get();
     return view('matches.create', compact('teams'));
 }
開發者ID:rcabr497,項目名稱:beerPongV2,代碼行數:12,代碼來源:MatchController.php

示例12: 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');
 }
開發者ID:kbiyo,項目名稱:ARTTv2,代碼行數:30,代碼來源:FFTTUpdateTeams.php

示例13: 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'));
 }
開發者ID:dinhtich1991,項目名稱:staff,代碼行數:39,代碼來源:DepartmentController.php

示例14: 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'));
 }
開發者ID:trongtri0705,項目名稱:staff,代碼行數:12,代碼來源:TeamController.php

示例15: 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);
 }
開發者ID:macewanCS,項目名稱:librasoft,代碼行數:26,代碼來源:SearchController.php


注:本文中的app\Team類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。