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


PHP Assets::Model方法代码示例

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


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

示例1: actionStoreValue

 public function actionStoreValue()
 {
     $id = $_GET['id'];
     $asset = Assets::Model()->findByPk($id);
     $this->storeSingleAssetValue($asset->typeID);
     $this->renderPartial('storeValue');
 }
开发者ID:Covert-Inferno,项目名称:prohd,代码行数:7,代码来源:AssetsController.php

示例2: storeData

 public function storeData($walletID)
 {
     $assets = $this->getEVEData($walletID);
     $character = Characters::model()->findByPk($walletID);
     Assets::Model()->deleteAll('characterID=:characterID', array(':characterID' => $character->characterID));
     //echo $assets->__toString();
     $this->parseAssets($assets->result->rowset->row, $character->characterID, 0);
 }
开发者ID:Covert-Inferno,项目名称:prohd,代码行数:8,代码来源:APIAssetList.php

示例3: number_format

					<td><img style='height: 18px; width: 18px; margin-right: 4px;' src='./images/items/<?php 
        echo $icon;
        ?>
'><?php 
        echo $baseAsset->typeName;
        ?>
</td>
					<td><?php 
        echo number_format($baseAsset->quantity, 0);
        $idx1++;
        ?>
</td>
				</tr>
			<?php 
        //Check the base assets for containership
        $contents = Assets::Model()->findAll('containerID=:containerID AND characterID IN ' . $groupMembersString . '', array(':containerID' => $baseAsset->itemID));
        if ($contents) {
            $idx = 1;
            foreach ($contents as $content) {
                ?>
					<?php 
                $icon = $this->getIcon($content->typeID);
                ?>

						<tr id="node-<?php 
                echo $assetLocation->locationID;
                ?>
-<?php 
                echo $baseAsset->itemID;
                ?>
-<?php 
开发者ID:Covert-Inferno,项目名称:prohd,代码行数:31,代码来源:index_old.php

示例4: CDbCriteria

<div class="currentstats">
<table>
<tr class="header1">
<td style="text-align: left; width: 220px;">Blueprint</td>
<td style="text-align: right; width: 10px;">Stock</td>
<td style="text-align: right; width: 10px;">Value</td>
<td style="text-align: right; width: 50px;">Total</td>
</tr>

<?php 
$index = 0;
$criteria = new CDbCriteria();
$criteria->select = 'SUM(quantity) AS quantity, typeID';
$criteria->order = 'typeName ASC';
$criteria->condition = 'groupID IN (915,525,643) GROUP BY typeID';
$results = Assets::Model()->findAll($criteria);
foreach ($results as $row) {
    if ($index % 2) {
        echo "<tr class='odd'>";
    } else {
        echo "<tr>";
    }
    $itemInfo = new CDbCriteria();
    $itemInfo->condition = 'typeID=:typeID';
    $itemInfo->params = array(':typeID' => $row->typeID);
    $itemName = Invtypes::Model()->find($itemInfo);
    //TEMP
    // Need to figure out BPC value
    $value = 1.0;
    echo "<td><div class='textCenter'><img style='height: 20px; width: 20px;' src='http://image.eveonline.com/Type/" . $row->typeID . "_32.png'><a href='index.php?r=wallet/item&id={$row->typeID}'>{$itemName->typeName}</div></td>";
    echo "<td style='text-align: right;'>{$row->quantity}</td>";
开发者ID:Covert-Inferno,项目名称:prohd,代码行数:31,代码来源:index.php

示例5: storeAssetValues

 function storeAssetValues($groupID)
 {
     $members = $this->getMembersAsCharIDArray($groupID);
     $sqlarray = '(' . implode(',', $members) . ')';
     $criteria = new CDbCriteria();
     $criteria->condition = 'characterID IN ' . $sqlarray;
     $criteria->group = 'typeID';
     $assetTypes = Assets::Model()->findAll($criteria);
     $i = 0;
     foreach ($assetTypes as $assetType) {
         $fullUrl = "http://api.eve-central.com/api/marketstat?typeid=" . $assetType->typeID . "&regionlimit=10000002";
         //Get the data and turn it into a SimpleXML object
         $dataFromHttp = @file_get_contents($fullUrl);
         try {
             $xml = new SimpleXMLElement($dataFromHttp);
         } catch (Exception $e) {
             return 0;
         }
         $assetValue = $xml->xpath('/evec_api/marketstat/type/sell/min');
         $exists = AssetValues::Model()->exists('typeID=:typeID', array(':typeID' => $assetType->typeID));
         if ($exists) {
             $valueTableRow = AssetValues::Model()->findByPk($assetType->typeID);
             $valueTableRow->value = (double) $assetValue[0];
             $valueTableRow->save();
         } else {
             $valueTableRow = new AssetValues();
             $valueTableRow->typeID = $assetType->typeID;
             $valueTableRow->value = (double) $assetValue[0];
             $valueTableRow->save();
         }
     }
 }
开发者ID:Covert-Inferno,项目名称:prohd,代码行数:32,代码来源:Controller.php


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