Ejemplo n.º 1
0
 public static function _getUserChanceOfGameByUser($user_id, $game_id, $game_price)
 {
     $chance = 0;
     if (!is_null($user)) {
         //if(isset(self::$chances_cache[$user->id])) return self::$chances_cache[$user->id];
         $bet = Bet::where('game_id', $game_id)->where('user_id', $user_id)->sum('price');
         if ($bet) {
             $chance = round($bet / $game_price, 3) * 100;
         }
         //self::$chances_cache[$user->id] = $chance;
     }
     return $chance;
 }