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