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


PHP Price::getItemPrice方法代码示例

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


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

示例1: usdeurgbp

 public static function usdeurgbp($totalprice)
 {
     $usd = 17;
     $eur = 13;
     $gbp = 10;
     $plex = Price::getItemPrice('29668', date('Ymd'));
     $usdval = $plex / $usd;
     $eurval = $plex / $eur;
     $gbpval = $plex / $gbp;
     return array('usd' => $totalprice / $usdval, 'eur' => $totalprice / $eurval, 'gbp' => $totalprice / $gbpval);
 }
开发者ID:Nord001,项目名称:zKillboard,代码行数:11,代码来源:Detail.php

示例2: beSocial

function beSocial($killID)
{
    global $beSocial, $mdb;
    if (!isset($beSocial)) {
        $beSocial = false;
    }
    if ($beSocial === false) {
        return;
    }
    if ($killID < 0) {
        return;
    }
    $ircMin = 10000000000.0;
    $twitMin = 10000000000.0;
    $kill = $mdb->findDoc('killmails', ['killID' => $killID]);
    if (@$kill['social'] == true) {
        return;
    }
    $hours24 = time() - 86400;
    if ($kill['dttm']->sec < $hours24) {
        return;
    }
    // Get victim info
    $victimInfo = $kill['involved'][0];
    if ($victimInfo == null) {
        return;
    }
    $totalPrice = $kill['zkb']['totalValue'];
    Info::addInfo($victimInfo);
    // Reduce spam of freighters and jump freighters
    $shipGroupID = $victimInfo['groupID'];
    if (in_array($shipGroupID, array(513, 902))) {
        $shipPrice = Price::getItemPrice($victimInfo['shipTypeID'], date('Ymd'));
        $ircMin += $shipPrice;
        $twitMin += $shipPrice;
    }
    $worthIt = false;
    $worthIt |= $totalPrice >= $ircMin;
    if (!$worthIt) {
        return;
    }
    $tweetIt = false;
    $tweetIt |= $totalPrice >= $twitMin;
    global $fullAddr, $twitterName;
    $url = "{$fullAddr}/kill/{$killID}/";
    if ($url == '') {
        $url = "{$fullAddr}/kill/{$killID}/";
    }
    $message = '|g|' . $victimInfo['shipName'] . '|n| worth |r|' . Util::formatIsk($totalPrice) . " ISK|n| was destroyed! {$url}";
    if (!isset($victimInfo['characterName'])) {
        $victimInfo['characterName'] = $victimInfo['corporationName'];
    }
    if (strlen($victimInfo['characterName']) < 25) {
        $name = $victimInfo['characterName'];
        if (Util::endsWith($name, 's')) {
            $name .= "'";
        } else {
            $name .= "'s";
        }
        $message = "{$name} {$message}";
    }
    $mdb->getCollection('killmails')->update(['killID' => $killID], ['$unset' => ['social' => true]]);
    Log::irc("{$message}");
    $message = Log::stripIRCColors($message);
    $message .= ' #tweetfleet #eveonline';
    if (strlen($message) > 120) {
        $message = str_replace(' worth ', ': ', $message);
    }
    if (strlen($message) > 120) {
        $message = str_replace(' was destroyed!', '', $message);
    }
    if ($tweetIt && strlen($message) <= 120) {
        $return = Twit::sendMessage($message);
        $twit = "https://twitter.com/{$twitterName}/status/" . $return->id;
        Log::irc("Message was also tweeted: |g|{$twit}");
    }
}
开发者ID:hybrid1969,项目名称:zKillboard,代码行数:77,代码来源:9.social.php

示例3: addItems

 public static function addItems(&$itemArray, $items, $killTime, $inContainer = 0, $parentFlag = 0)
 {
     if ($items == null) {
         return;
     }
     if (is_array($items)) {
         foreach ($items as $item) {
             $typeID = $item['itemType']['id'];
             $item['typeID'] = $typeID;
             $item['price'] = Price::getItemPrice($typeID, $killTime);
             $item['inContainer'] = $inContainer;
             if ($inContainer) {
                 $item['flag'] = $parentFlag;
             }
             if ($inContainer && strpos(Info::getInfoField('typeID', $typeID, 'name'), 'Blueprint')) {
                 $item['singleton'] = 2;
             }
             unset($item['_stringValue']);
             $itemArray[] = $item;
             $subItems = isset($item['items']) ? $item['items'] : null;
             unset($item['items']);
             if ($subItems != null) {
                 self::addItems($itemArray, $subItems, $killTime, 1, $item['flag']);
             }
         }
     }
 }
开发者ID:nasimnabavi,项目名称:zKillboard,代码行数:27,代码来源:Kills.php

示例4: header

global $mdb;
if (!is_numeric($id)) {
    $id = Info::getItemId($id);
    if ($id > 0) {
        header("Location: /item/{$id}/");
    } else {
        header('Location: /');
    }
    die;
}
$info = $mdb->findDoc("information", ['type' => 'typeID', 'id' => (int) $id, 'cacheTime' => 3600]);
$info['typeName'] = $info['name'];
$info['description'] = str_replace('<br>', "\n", @$info['description']);
$info['description'] = strip_tags(@$info['description']);
$info['price'] = Price::getItemPrice($id, date('Ymd'));
global $mdb;
$cursor = $mdb->getCollection('killmails')->find(['involved.shipTypeID' => (int) $id]);
$hasKills = $cursor->hasNext();
$info['attributes'] = array();
$info['market'] = Db::query('select * from zz_item_price_lookup where typeID = :typeID order by priceDate desc limit 30', array(':typeID' => $id));
$kills = $mdb->find('itemmails', ['typeID' => (int) $id], ['killID' => -1], 50);
$victims = [];
foreach ($kills as $row) {
    $kill = $mdb->findDoc('killmails', ['killID' => $row['killID']]);
    $victim = $kill['involved'][0];
    $victim['destroyed'] = $row['killID'];
    $victims[] = $victim;
}
Info::addInfo($victims);
$app->render('item.html', array('info' => $info, 'hasKills' => $hasKills, 'kills' => $victims));
开发者ID:nasimnabavi,项目名称:zKillboard,代码行数:30,代码来源:item.php

示例5: processItem

function processItem($item, $dttm, $isCargo = false, $parentContainerFlag = -1)
{
    global $mdb;
    $typeID = $item['itemType']['id'];
    $itemName = $mdb->findField("information", 'name', ['type' => 'typeID', 'id' => (int) $typeID]);
    if ($itemName == null) {
        $itemName = "TypeID {$typeID}";
    }
    if ($typeID == 33329 && $item['flag'] == 89) {
        $price = 0.01;
    } else {
        $price = Price::getItemPrice($typeID, $dttm, true);
    }
    if ($isCargo && strpos($itemName, 'Blueprint') !== false) {
        $item['singleton'] = 2;
    }
    if ($item['singleton'] == 2) {
        $price = $price / 100;
    }
    return $price * (@$item['quantityDropped'] + @$item['quantityDestroyed']);
}
开发者ID:hybrid1969,项目名称:zKillboard,代码行数:21,代码来源:3.queueProcess.php

示例6: processItem

function processItem($item, $dttm, $isCargo = false, $parentContainerFlag = -1)
{
    $typeID = $item['itemType']['id'];
    $itemName = Db::queryField('select typeName from ccp_invTypes where typeID = :typeID', 'typeName', array(':typeID' => $typeID), 0);
    if ($itemName == null) {
        $itemName = "TypeID {$typeID}";
    }
    if ($typeID == 33329 && $item['flag'] == 89) {
        $price = 0.01;
    } else {
        $price = Price::getItemPrice($typeID, $dttm, true);
    }
    if ($isCargo && strpos($itemName, 'Blueprint') !== false) {
        $item['singleton'] = 2;
    }
    if ($item['singleton'] == 2) {
        $price = $price / 100;
    }
    return $price * (@$item['quantityDropped'] + @$item['quantityDestroyed']);
}
开发者ID:WreckerWorld,项目名称:zKillboard,代码行数:20,代码来源:3.queueProcess.php

示例7: processItem

 /**
  * @param integer $itemInsertOrder
  */
 private static function processItem(&$kill, &$killID, &$item, $itemInsertOrder, $isCargo = false, $parentContainerFlag = -1)
 {
     global $itemNames;
     if ($itemNames == null) {
         $itemNames = array();
         $results = Db::query("select typeID, typeName from ccp_invTypes", array(), 3600);
         foreach ($results as $row) {
             $itemNames[$row["typeID"]] = $row["typeName"];
         }
     }
     $typeID = $item["typeID"];
     if (isset($item["typeID"]) && isset($itemNames[$item["typeID"]])) {
         $itemName = $itemNames[$item["typeID"]];
     } else {
         $itemName = "TypeID {$typeID}";
     }
     if ($item["typeID"] == 33329 && $item["flag"] == 89) {
         $price = 0.01;
     } else {
         $price = Price::getItemPrice($typeID);
     }
     if ($isCargo && strpos($itemName, "Blueprint") !== false) {
         $item["singleton"] = 2;
     }
     if ($item["singleton"] == 2) {
         $price = $price / 100;
     }
     Db::execute("insert ignore into zz_item_price_lookup (typeID, priceDate, price) values (:typeID, now(), :price)", array(":typeID" => $item["typeID"], ":price" => $price));
     return $price * ($item["qtyDropped"] + $item["qtyDestroyed"]);
 }
开发者ID:Covert-Inferno,项目名称:zKillboard,代码行数:33,代码来源:Parser.php

示例8: date

<?php

require_once "../init.php";
$date = date('Ymd', time() - 7200);
$yesterday = date('Y-m-d', time() - 7200 - 86400);
$key = "tq:pricesChecked:{$date}";
if ($redis->get($key) == true) {
    exit;
}
$crestPrices = CrestTools::getJson("https://public-crest.eveonline.com/market/prices/");
if (!isset($crestPrices['items'])) {
    exit;
}
foreach ($crestPrices['items'] as $item) {
    $typeID = $item['type']['id'];
    $price = Price::getItemPrice($typeID, $date, true);
    $marketHistory = $mdb->findDoc("prices", ['typeID' => $typeID]);
    if ($marketHistory === null) {
        $marketHistory = ['typeID' => $typeID];
        $mdb->save("prices", $marketHistory);
    }
    if (!isset($marketHistory[$yesterday]) && isset($item['averagePrice'])) {
        $avgPrice = $item['averagePrice'];
        $mdb->set("prices", ['typeID' => $typeID], [$yesterday => $avgPrice]);
    }
}
$redis->set($key, true);
开发者ID:a-tal,项目名称:zKillboard,代码行数:27,代码来源:9.pricePrimer.php

示例9: usdeurgbp

function usdeurgbp($totalprice)
{
    $usd = 17;
    $eur = 13;
    $gbp = 10;
    $plex = Price::getItemPrice("29668");
    $usdval = $plex / $usd;
    $eurval = $plex / $eur;
    $gbpval = $plex / $gbp;
    return array("usd" => $totalprice / $usdval, "eur" => $totalprice / $eurval, "gbp" => $totalprice / $gbpval);
}
开发者ID:Covert-Inferno,项目名称:zKillboard,代码行数:11,代码来源:detail.php


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