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


PHP Player::where方法代码示例

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


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

示例1: run

 public function run()
 {
     Eloquent::unguard();
     $user = User::first();
     DB::table('tournaments')->truncate();
     DB::table('players_tournaments')->truncate();
     $tournament = new Tournament(array('user' => $user->id, 'name' => 'Tournois du 26 avril'));
     $tournament->save();
     $tournament2 = new Tournament(array('user' => $user->id, 'name' => 'Tournois du 26 mai'));
     $tournament2->save();
     $it = 0;
     foreach (Player::where('name', '<>', User::GHOST)->get() as $player) {
         $tournament->players()->attach($player->id);
         if ($it % 2 == 0) {
             $tournament2->players()->attach($player->id);
         }
         $it++;
     }
 }
开发者ID:romainmasc,项目名称:jackmarshall,代码行数:19,代码来源:DatabaseSeeder.php

示例2: Validate_DBID_Exists

 public function Validate_DBID_Exists($db_id, $player_name, $api_key)
 {
     /*
      ***********************************
      ** Check existing name/db_id     **
      ***********************************
      *  Does the db_id exist?
      *  Does the submitted name match existing?
      */
     $check_existing_sql = Player::where('db_id', '=', $db_id)->order_by('created_at', 'DESC')->first();
     if ($check_existing_sql) {
         if ($check_existing_sql->name != $player_name) {
             Log::warn("Existing db_id does not match existing name({$db_id}|in:{$player_name}|existing:{$check_existing_sql->name})");
             return false;
         }
         if ($check_existing_sql->api_key != $api_key) {
             //api key isn't blank and does not match!
             Log::warn("API key missmatch: " . $db_id);
             return false;
         }
     }
     return true;
 }
开发者ID:odie5533,项目名称:ThumpDumpDB,代码行数:23,代码来源:ValidationController.php

示例3: postAdd

 public function postAdd()
 {
     $rules = array('playerid' => 'required|numeric|exists:players,playerid', 'donatoramount' => 'numeric|required', 'donatorduration' => 'numeric|required', 'donatordate' => 'required', 'reason' => 'required');
     $validator = Validator::make(Input::all(), $rules);
     if ($validator->passes() && Auth::user()->canEditPlayerAdmin(Input::get('playerid'))) {
         $player = Player::where('playerid', Input::get('playerid'))->first();
         $log = new Adminlog();
         $log->type = 'player';
         $log->editor = Auth::user()->id;
         $log->objectid = $player->uid;
         $log->reason = Input::get('reason');
         $log->difference = $log->getDifference(array('donatorlvl' => $player->donatorlvl, 'donatordate' => $player->donatordate, 'donatoramount' => $player->donatoramount, 'donatorduration' => $player->donatorduration), array('donatorlvl' => 5, 'donatordate' => Input::get('donatordate'), 'donatoramount' => Input::get('donatoramount') * 1, 'donatorduration' => Input::get('donatorduration')));
         $log->save();
         $player->donatorlvl = 5;
         $player->donatordate = Input::get('donatordate');
         $player->donatoramount = Input::get('donatoramount') * 1;
         $player->donatorduration = Input::get('donatorduration');
         $player->save();
         return Redirect::to('/donators')->with(array('message' => 'Die Änderung wurde erfolgreich übernommen.', 'type' => 'success'));
     } else {
         return Redirect::to('/donators')->with(array('message' => 'Leider ist ein Fehler aufgetreten, die Änderung wurde verworfen.', 'type' => 'danger'));
     }
 }
开发者ID:GlitchedMan,项目名称:a3l-webinterface,代码行数:23,代码来源:DonatorsController.php

示例4:

<?php

// listItem : nom de la procedure dans le model
$listItem = 'newListItem';
// Clubs déjà selectionnes
$playerExistes = MySession::getModel('compet')->getListPlayerId();
// Datas - cherche par Nom
if ($inputs['nom'] == 'parNom') {
    $datas = Player::where('nom', 'LIKE', '%' . $inputs['search'] . '%')->whereNotIn('id', $playerExistes)->orderBy('nom', 'ASC')->get();
}
// Datas - cherche par Licence
if ($inputs['nom'] == 'parLicence') {
    $datas = Player::whereLicence($inputs['search'])->whereNotIn('id', $playerExistes)->orderBy('nom', 'ASC')->get();
}
// Limit datas to show : if 0 or not exist then value no limit
$param['maxData'] = '60';
// Sub-titre
$param['sub-titre'] = 'Sélectionnez un joueur';
// Select Route
$param['selectRoute'] = 'entreeplayer.place';
$param['selectText'] = '';
$param['moreParams'] = $inputs['id'];
// Actions
$param['actions'] = 'place';
// BackUrl
$param['backUrl'] = 'entree';
?>


<!-- List.Blade -->
开发者ID:birdiebel,项目名称:G2016,代码行数:30,代码来源:playerselect.blade.php

示例5: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $team = Team::where('identifier', '=', $id)->first();
     $players = Player::where('teamIdentifier', '=', $id)->get();
     return View::make('team.details', ['team' => $team, 'players' => $players]);
 }
开发者ID:piyrus,项目名称:proware,代码行数:12,代码来源:TeamController.php

示例6: Set_Player_Basic_Info

 public function Set_Player_Basic_Info($db_id, $input)
 {
     if (Cache::has($this->class_name . "_" . $db_id . "_Basic_MD5")) {
         //check the input MD5 against this
         if (md5($input) == Cache::get($this->class_name . "_" . $db_id . "_Basic_MD5")) {
             Player::where('db_id', '=', $db_id)->touch();
             return true;
         }
     } else {
         try {
             $is_addon_user = 1;
             $query_add_player = "INSERT INTO `players` ";
             $query_add_player .= "(name, armyTag, instanceId, db_id, e_id,";
             $query_add_player .= "armyId, current_archetype, region, ";
             $query_add_player .= "created_at, updated_at) ";
             $query_add_player .= "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ";
             $query_add_player .= "ON DUPLICATE KEY UPDATE ";
             $query_add_player .= "name = ?, armyTag = ?, instanceId = ?, armyId = ?, ";
             $query_add_player .= "e_id = ?, current_archetype = ?, addon_user = ?, region = ?, ";
             $query_add_player .= "updated_at = ?";
             $bindings = array($input['player_name'], $input['player_army_tag'], $input['player_instance_id'], $db_id, $input['player_eid'], $input['player_army_id'], $input['player_current_archetype'], $input['player_region'], $this->date, $this->date, $input['player_name'], $input['player_army_tag'], $input['player_instance_id'], $input['player_army_id'], $input['player_eid'], $input['player_current_archetype'], $is_addon_user, $input['player_region'], $this->date);
             if (!DB::query($query_add_player, $bindings)) {
                 throw new Exception('Add/Update player query failed');
             }
         } catch (Exception $e) {
             Log::info($log_header . $e->getMessage());
             file_put_contents($this->logpath . $this->logdate . '_bad_player.json', json_encode($input));
             return false;
         }
     }
     //set cache file and cache MD5 file
     Cache::forever($this->class_name . "_" . $db_id . "_Basic", json_encode($input));
     Cache::forever($this->class_name . "_" . $db_id . "_Basic_MD5", md5($input));
     return true;
 }
开发者ID:odie5533,项目名称:ThumpDumpDB,代码行数:35,代码来源:PlayerAPIController.php

示例7: get_player_certs

 public function get_player_certs($name = NULL)
 {
     //searching by name, null name = no buenos
     if ($name == NULL) {
         return Response::error('404');
     } else {
         $input_name = urldecode($name);
     }
     //Look up the player, latest to account for deletes with the same name
     $player = Player::where('name', '=', $input_name)->order_by('created_at', 'DESC')->first();
     //no player found, why not search?
     if (!$player) {
         return Response::error('404');
     }
     //Does the player have an army?
     $army = Army::where('armyId', '=', $player->armyid)->order_by('created_at', 'DESC')->first();
     //escape for output in title
     $playerName = htmlentities($player->name);
     //Player website preferences
     $web_prefs = WebsitePref::where('db_id', '=', $player->db_id)->first();
     if (isset($web_prefs->attributes)) {
         $web_prefs = $web_prefs->attributes;
     }
     //website prefs we care about - show_workbench, show_craftables, show_market_listings
     if (!isset($web_prefs['show_workbench'])) {
         $web_prefs['show_workbench'] = 1;
     }
     if (!isset($web_prefs['show_craftables'])) {
         $web_prefs['show_craftables'] = 0;
     }
     if (!isset($web_prefs['show_market_listings'])) {
         $web_prefs['show_market_listings'] = 0;
     }
     if ($web_prefs['show_market_listings']) {
         //find out what this player has currently listed on the market
         $cache_key_player_market = $player->db_id . "_market_listings";
         if (Cache::has($cache_key_player_market)) {
             //pull from cache
             $cached_market_listings = Cache::get($cache_key_player_market);
             $item_stats_lookup = $cached_market_listings['stats'];
             $market_listings = $cached_market_listings['data'];
         } else {
             $market_listings = MarketListing::where('active', '=', '1')->where('character_guid', '=', $player->db_id)->get(array('item_sdb_id', 'expires_at', 'price_cy', 'price_per_unit', 'rarity', 'quantity', 'title', 'icon', 'ff_id', 'category'));
             if (!empty($market_listings)) {
                 $market_stat_ids = array();
                 $market_stat_cats = array();
                 foreach ($market_listings as $listing) {
                     $market_stat_ids[] = $listing->attributes['ff_id'];
                     $market_stat_cats[] = $listing->attributes['category'];
                 }
                 if (count($market_stat_cats) < 1) {
                     $stats = false;
                 }
                 $market_stat_cats_unique = array_unique($market_stat_cats);
                 $item_stats_lookup = false;
                 foreach ($market_stat_cats_unique as $statcat) {
                     switch ($statcat) {
                         case 'AbilityModule':
                             $stats = MarketStatAbilityModule::where_in('marketlisting_id', $market_stat_ids)->get();
                             foreach ($stats as $stat) {
                                 $temp = '<table>';
                                 $ustats = (array) unserialize($stat->stats);
                                 ksort($ustats);
                                 foreach ($ustats as $key => $value) {
                                     $key = str_replace('_', ' ', $key);
                                     $key = ucwords($key);
                                     $value = number_format($value, 2);
                                     $temp .= '<tr><td>' . htmlentities($key) . ': </td><td>' . htmlentities($value) . '</td></tr>';
                                 }
                                 $temp .= '</table>';
                                 $item_stats_lookup[(string) $stat->marketlisting_id] = $temp;
                             }
                             break;
                         case 'CraftingComponent':
                             $stats = MarketStatCraftingComponent::where_in('marketlisting_id', $market_stat_ids)->get();
                             foreach ($stats as $stat) {
                                 $temp = '';
                                 $key_lookup = array('mass' => 'MASS', 'power' => 'PWR', 'cpu' => 'CPU');
                                 ksort($stat->attributes);
                                 foreach ($stat->attributes as $key => $value) {
                                     if ($value > 0 && array_key_exists($key, $key_lookup)) {
                                         $temp .= htmlentities($key_lookup[$key]) . ': ' . htmlentities($value) . '<br>';
                                     }
                                 }
                                 $item_stats_lookup[(string) $stat->marketlisting_id] = $temp;
                             }
                             break;
                         case 'Jumpjet':
                             $stats = MarketStatJumpjet::where_in('marketlisting_id', $market_stat_ids)->get();
                             foreach ($stats as $stat) {
                                 $temp = '<table>';
                                 $key_lookup = array('id', 'updated_at', 'created_at', 'marketlisting_id');
                                 ksort($stat->attributes);
                                 foreach ($stat->attributes as $key => $value) {
                                     if (!in_array($key, $key_lookup)) {
                                         $key = str_replace('_', ' ', $key);
                                         $key = ucwords($key);
                                         $value = number_format($value, 2);
                                         $temp .= '<tr><td>' . htmlentities($key) . ': </td><td>' . htmlentities($value) . '</td></tr>';
                                     }
//.........这里部分代码省略.........
开发者ID:odie5533,项目名称:ThumpDumpDB,代码行数:101,代码来源:player_stores.php

示例8: fantom

 public static function fantom()
 {
     return Player::where('name', '=', User::GHOST)->where('user', '=', Auth::user()->id)->first();
 }
开发者ID:romainmasc,项目名称:jackmarshall,代码行数:4,代码来源:User.php

示例9: get_single_battleframe

 public function get_single_battleframe($name = NULL, $frame_name = NULL)
 {
     //searching by name, null name = no buenos
     if ($name == NULL || $frame_name == NULL) {
         return Response::error('404');
     } else {
         $input_name = urldecode($name);
     }
     $valid_frame_name = array('assault', 'firecat', 'tigerclaw', 'biotech', 'recluse', 'dragonfly', 'dreadnaught', 'rhino', 'mammoth', 'engineer', 'electron', 'bastion', 'recon', 'raptor', 'nighthawk', 'arsenal');
     if (!in_array($frame_name, $valid_frame_name)) {
         return Response::error('404');
     }
     //Look up the player, latest to account for deletes with the same name
     $player = Player::where('name', '=', $input_name)->order_by('created_at', 'DESC')->first();
     //no player found, why not search?
     if (!$player) {
         return Response::error('404');
     }
     //escape for output in title
     $playerName = htmlentities($player->name);
     //Player website preferences
     $web_prefs = WebsitePref::where('db_id', '=', $player->db_id)->first();
     if (isset($web_prefs->attributes)) {
         $web_prefs = $web_prefs->attributes;
     }
     //loadouts
     /*
         Mappings:
             $loadout->Gear[$i] = Currently equipped items array
             $loadout->Gear[$i]->slot_index
             $loadout->Gear[$i]->info->durability->pool
             $loadout->Gear[$i]->info->durability->current
             $loadout->Gear[$i]->info->attribute_modifiers[$k] = array of custom attributes for this item
             $loadout->Gear[$i]->info->quality = The quality of the crafted item
             $loadout->Gear[$i]->info->creator_guid = the creators unique player ID
             $loadout->Gear[$i]->info->item_sdb_id = The root item this was crafted from
     
             $loadout->Weapons[$i] = Currently equiped weapons array
             $loadout->Weapons[$i]->info->durability->pool
             $loadout->Weapons[$i]->info->durability->current
             $loadout->Weapons[$i]->info->attribute_modifiers[$k]
             $loadout->Weapons[$i]->info->quality
             $loadout->Weapons[$i]->info->creator_guid
             $loadout->Weapons[$i]->info->item_sdb_id
             $loadout->Weapons[$i]->allocated_power
             $loadout->Weapons[$i]->slot_index = Weapon slot, 0 is main hand, 1 is alt weapon
     */
     /*
         Attribute modifiers mapping:
             5   = Jet Energy Recharge
             6   = health
             7   = health regen
             12  = Run Speed
             29  = weapon splash radius
             35  = Energy (for jetting)
             37  = Jump Height
             950 = Max durability pool
             951 = Mass (unmodified - YOU MUST take the abs of this to get it to display correctly!)
             952 = Power (unmodified - YOU MUST take the abs of this to get it to display correctly!)
             953 = CPU (unmodified - YOU MUST take the abs of this to get it to display correctly!)
             956 = clip size
             954 = damage per round
             977 = Damage
             978 = Debuff Duration
             1121= Air Sprint
     
             Defaults for weapons are set in the "hstats" table.
     */
     if (isset($web_prefs['show_loadout'])) {
         if ($web_prefs['show_loadout'] == 1) {
             $loadout = Loadout::where('db_id', '=', $player->db_id)->first();
         } else {
             $loadout = null;
         }
     } else {
         $loadout = Loadout::where('db_id', '=', $player->db_id)->first();
     }
     if ($loadout) {
         //Lets play the cache game, where all the stuff is stored locally and the points don't matter!
         $loadout = unserialize($loadout->entry);
         //VERSION 0.6 CHECKING (Array = Good, Object = BAD!)
         if (gettype($loadout) == "object") {
             //This is from version 0.6, we can no longer use this data.
             $loadout = null;
         }
         $cache_key_loadouts = $player->db_id . "_loadouts";
         $loadout_md5 = md5(serialize($loadout));
         if (Cache::Get($cache_key_loadouts . '_md5') != $loadout_md5 && $loadout != null) {
             //Oh I am playing the game, the one that will take me to my end.
             //Make sure this isnt a terrible send
             if (isset($loadout[0]->Gear)) {
                 for ($k = 0; $k < count($loadout); $k++) {
                     if ($loadout[$k]->Chassis_ID == 77733 || $loadout[$k]->Chassis_ID == 82394 || $loadout[$k]->Chassis_ID == 31334) {
                         //ignore the training frame
                     } else {
                         //Break each loadout into its own cache
                         Cache::forever($cache_key_loadouts . '_' . $loadout[$k]->Chassis_ID, $loadout[$k]);
                     }
                 }
                 //Cache the loadout md5 so we can call it again later
//.........这里部分代码省略.........
开发者ID:odie5533,项目名称:ThumpDumpDB,代码行数:101,代码来源:player_data.php

示例10: get_barsiggen

 public function get_barsiggen($name = NULL, $beer = NULL, $frame_request = NULL)
 {
     //Your arguments must be recognized in Fort Kickass
     if (is_null($beer) || is_null($name) || is_null($frame_request)) {
         return Response::error('404');
     }
     //Light beer vs. Dark beer, the showdown -  Thanks Van.
     if (!in_array($beer, array('light', 'dark'))) {
         return Response::error('404');
     }
     //check to make sure in valid frame names
     //don't forget "barsig" for current
     $valid_frame_requests = array('barsig', 'arsenal', 'assault', 'firecat', 'tigerclaw', 'biotech', 'recluse', 'dragonfly', 'dreadnaught', 'rhino', 'mammoth', 'engineer', 'electron', 'bastion', 'recon', 'raptor', 'nighthawk');
     if (!in_array($frame_request, $valid_frame_requests)) {
         return Response::error('404');
     }
     //Alright, now that I'm nice and limber.  Let's see if you're even people.
     $input_name = urldecode($name);
     $player = Player::where('name', '=', $input_name)->order_by('created_at', 'DESC')->first();
     //If you're not even people (like Xtops), go away
     if (is_null($player)) {
         return Response::error('404');
     }
     //STOP.  Hammertime.  Get that data.  Set that data straight.
     $output_name = "";
     $output_xp = "";
     $output_class = "";
     $output_weapon = "";
     $current_frame = "";
     //Let's set the player name with army tag if it exists
     $playerName = htmlentities($player->name);
     if (isset($player->armytag) && strlen($player->armytag) > 1) {
         $output_name = htmlentities($player->armytag . ' ' . $player->name);
     } else {
         $output_name = htmlentities($player->name);
     }
     //Alright, now we're making progress!  (get it?)
     //Naw, let's just copy X5s
     $cache_key = $playerName . "_" . $beer . "_sig_" . $frame_request;
     if (!Cache::has($player->db_id . '_' . $beer . '_sig_' . $frame_request)) {
         $progress = Progress::where('db_id', '=', $player->db_id)->order_by('updated_at', 'DESC')->first();
         if ($progress) {
             $progress = unserialize($progress->entry);
             $cache_key_progress = $player->db_id . "_progress";
             if (isset($progress->xp) && isset($progress->chassis_id)) {
                 //if we're barsig only, current frame, if not check entry for other frame exists
                 if ($frame_request == 'barsig') {
                     $current_frame = $progress->chassis_id;
                 } else {
                     $frame_request_exists = self::simpleNameToChassisId($frame_request);
                     if (!$frame_request_exists) {
                         return Response::error('404');
                     } else {
                         $current_frame = $frame_request_exists;
                     }
                 }
                 foreach ($progress->xp as $chassy) {
                     if ($chassy->sdb_id == $current_frame) {
                         $output_xp = $chassy->lifetime_xp;
                         break;
                     }
                 }
             } else {
                 //we need this data, abort!
                 return Response::error('404');
             }
         } else {
             //We kind of need progress in order to display anything so if the user doesn't have a progress than abort everything.
             return Response::error('404');
         }
         $output_xp = number_format($output_xp / 1000000, 2) . 'M XP';
         //Classy.  But if not, gtfo
         $output_class = strtolower(self::chassisIdToSimpleName($current_frame));
         if (!$output_class) {
             Log::info('no class: ' . $current_frame);
             return Response::error('404');
         }
         //WEAPON ICONS, ASSEMBLE
         switch ($output_class) {
             case 'arsenal':
             case 'assault':
             case 'firecat':
             case 'tigerclaw':
                 $output_weapon = 'assault';
                 break;
             case 'engineer':
             case 'bastion':
             case 'electron':
                 $output_weapon = 'engineer';
                 break;
             case 'dreadnaught':
             case 'mammoth':
             case 'rhino':
                 $output_weapon = 'dreadnaught';
                 break;
             case 'biotech':
             case 'recluse':
             case 'dragonfly':
                 $output_weapon = 'biotech';
                 break;
//.........这里部分代码省略.........
开发者ID:odie5533,项目名称:ThumpDumpDB,代码行数:101,代码来源:signature_generator.php

示例11: post_printer


//.........这里部分代码省略.........
          *  @ sets $player_eid
          *
          *  -Greater than 0
          *  -Expected length 9 or 10, but others possible
          */
         //Sent only numbers
         if (preg_match('/[^0-9]/', $line->Player_EID)) {
             throw new Exception("Player ({$player_db_id}) EID contained something other than a number: " . $line->Player_EID);
         }
         //EID should be as long as a db_id
         if (strlen($line->Player_EID) !== 19) {
             Log::warn("Player ({$player_db_id}) EID was not the expected 19 digits long: " . $line->Player_EID);
             $line->Player_EID = NULL;
         }
         $player_eid = $line->Player_EID;
         /*
          **********************************
          ** Validate Player Name/Army Tag**
          **********************************
          *  # Warn if invalid
          *  @ sets $player_name
          *  @ sets $player_army_tag
          *
          *  -15 + 6 characters or less ~23 to be safe
          *  -We don't care about character content as much as FF does
          */
         //Check if name is way too long, or too short
         if (strlen($line->Player_Name) > 30 || trim(strlen($line->Player_Name)) < 3) {
             throw new Exception("Player ({$player_db_id}) name was longer than 30 characters, should be <= 23: " . $line->Player_Name);
         }
         //Warn if longer than expected (that's what she said)
         //But allow for armytag length too
         if (strlen($line->Player_Name) > 25) {
             Log::warn("Player ({$player_db_id}) sent a character name longer than max expected length of 23: " . $line->Player_Name);
         }
         //Name is ok, but does it have an army tag?  Does it blend?
         if (strpos($line->Player_Name, ']')) {
             $last = strripos($line->Player_Name, ']') + 1;
             $player_army_tag = substr($line->Player_Name, 0, $last);
             $player_name = trim(substr($line->Player_Name, $last));
         } else {
             $player_army_tag = NULL;
             $player_name = $line->Player_Name;
         }
         /*
          ***********************************
          ** Verify times and ids are ints **
          ***********************************
          *  ready_at, started_at, blueprint_id
          */
         $player_crafts = array();
         $now = date('Y-m-d H:i:s');
         foreach ($line->Player_Craft_Queue as $cq) {
             //we expect only three keys
             if (!isset($cq->ready_at) || !isset($cq->started_at) || !isset($cq->blueprint_id)) {
                 continue;
             } else {
                 if (is_numeric($cq->ready_at) && is_numeric($cq->started_at) && is_numeric($cq->blueprint_id)) {
                     $player_crafts[] = array('db_id' => $player_db_id, 'ready_at' => $cq->ready_at, 'started_at' => $cq->started_at, 'blueprint_id' => $cq->blueprint_id, 'created_at' => $now, 'updated_at' => $now);
                 } else {
                     throw new Exception("Craft Queue values contained something other than a number.");
                 }
             }
             //all keys set
         }
         //foreach
         /*
          ***********************************
          ** Check existing name/db_id/eid **
          ***********************************
          *  Does the db_id exist?
          *  Does the submitted name match existing?
          *  Does the submitted eid match existing?
          */
         $check_existing_sql = Player::where('db_id', '=', $player_db_id)->order_by('created_at', 'DESC')->first();
         if ($check_existing_sql) {
             if ($check_existing_sql->name != $player_name) {
                 throw new Exception("Existing db_id does not match existing name({$player_db_id}|in:{$player_name}|existing:{$check_existing_sql->name})");
                 Log::warn("Existing db_id does not match existing name({$player_db_id}|in:{$player_name}|existing:{$check_existing_sql->name})");
             }
             if ($check_existing_sql->e_id != $player_eid) {
                 throw new Exception("Existing db_id does not match existing name({$player_db_id}|in:{$player_eid}|existing:{$check_existing_sql->e_id})");
                 Log::warn("Existing db_id does not match existing eid({$player_db_id}|in:{$player_eid}|existing:{$check_existing_sql->e_id})");
             }
         }
         //Delete existing records before adding new ones
         DB::table('printers')->where('db_id', '=', $player_db_id)->delete();
         //add new records
         if (count($player_crafts) > 0) {
             $crafts_in = DB::table('printers')->insert($player_crafts);
         } else {
             $crafts_in = false;
         }
         Cache::forever($player_db_id . '_printer', $player_crafts);
     } catch (Exception $e) {
         Log::info($log_header . $e->getMessage());
         file_put_contents($this->logpath . $this->logdate . '_printer.json', serialize($line));
     }
     return Response::json(array('ThumpDumpDB' => '(Printer) Thanks'));
 }
开发者ID:odie5533,项目名称:ThumpDumpDB,代码行数:101,代码来源:addon_v2.php

示例12: contactEdit

 public function contactEdit($id, $contact)
 {
     $contact = Contact::find($contact);
     $user = Auth::user();
     $player = Player::where('id', $id)->with('contacts')->first();
     $follow = Follower::where("user_id", "=", $player->user_id)->get();
     $club = $user->Clubs()->FirstOrFail();
     function search_in_array($value, $array)
     {
         if (in_array($value, $array)) {
             return true;
         }
         foreach ($array as $item) {
             if (is_array($item) && search_in_array($value, $item)) {
                 return true;
             }
         }
         return false;
     }
     //validate permission to edit contact
     $permission = search_in_array($contact->id, $player->toArray());
     if (!$permission) {
         return Response::view('shared.404', array(), 404);
     }
     $title = 'League Together - Contact Edit';
     return View::make('app.club.contact.edit')->with('page_title', $title)->with('player', $player)->with('club', $club)->with('contact', $contact)->withUser($user);
 }
开发者ID:illuminate3,项目名称:league-production,代码行数:27,代码来源:ClubController.php

示例13: statistics

 public function statistics()
 {
     $counts = ["negativ" => Player::where('gametype', '=', 'negativ')->count(), "positiv" => Player::where('gametype', '=', 'positiv')->count(), "neutral" => Player::where('gametype', '=', 'neutral')->count()];
     echo "Anzahl aktuell: n " . $counts["negativ"] . ' p ' . $counts["positiv"] . " neutral " . $counts['neutral'] . '<br>' . "<br>" . "Anzahl 1: " . ' negativ ' . Player::where('gametype', '=', 'negativ')->where('type', '=', "1")->count() . ' neutral ' . Player::where('gametype', '=', 'neutral')->where('type', '=', "1")->count() . ' positiv ' . Player::where('gametype', '=', 'positiv')->where('type', '=', "1")->count() . "<br>" . "Anzahl 2: " . ' negativ ' . Player::where('gametype', '=', 'negativ')->where('type', '=', "2")->count() . ' neutral ' . Player::where('gametype', '=', 'neutral')->where('type', '=', "2")->count() . ' positiv ' . Player::where('gametype', '=', 'positiv')->where('type', '=', "2")->count() . "<br>" . "Anzahl 3: " . ' negativ ' . Player::where('gametype', '=', 'negativ')->where('type', '=', "3")->count() . ' neutral ' . Player::where('gametype', '=', 'neutral')->where('type', '=', "3")->count() . ' positiv ' . Player::where('gametype', '=', 'positiv')->where('type', '=', "3")->count() . "<br>" . "Anzahl 4: " . ' negativ ' . Player::where('gametype', '=', 'negativ')->where('type', '=', "4")->count() . ' neutral ' . Player::where('gametype', '=', 'neutral')->where('type', '=', "4")->count() . ' positiv ' . Player::where('gametype', '=', 'positiv')->where('type', '=', "4")->count() . "<br>" . "Anzahl 5: " . ' negativ ' . Player::where('gametype', '=', 'negativ')->where('type', '=', "5")->count() . ' neutral ' . Player::where('gametype', '=', 'neutral')->where('type', '=', "5")->count() . ' positiv ' . Player::where('gametype', '=', 'positiv')->where('type', '=', "5")->count() . "<br>" . "Anzahl 6: " . ' negativ ' . Player::where('gametype', '=', 'negativ')->where('type', '=', "6")->count() . ' neutral ' . Player::where('gametype', '=', 'neutral')->where('type', '=', "6")->count() . ' positiv ' . Player::where('gametype', '=', 'positiv')->where('type', '=', "6")->count() . "<br>" . "Anzahl 7: " . ' negativ ' . Player::where('gametype', '=', 'negativ')->where('type', '=', "7")->count() . ' neutral ' . Player::where('gametype', '=', 'neutral')->where('type', '=', "7")->count() . ' positiv ' . Player::where('gametype', '=', 'positiv')->where('type', '=', "7")->count() . "<br>" . "Anzahl 8: " . ' negativ ' . Player::where('gametype', '=', 'negativ')->where('type', '=', "8")->count() . ' neutral ' . Player::where('gametype', '=', 'neutral')->where('type', '=', "8")->count() . ' positiv ' . Player::where('gametype', '=', 'positiv')->where('type', '=', "8")->count();
 }
开发者ID:sanderdrummer,项目名称:Homepages,代码行数:5,代码来源:HomeController.php


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