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


PHP Orders::Model方法代码示例

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


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

示例1: storeData

 public function storeData($walletID)
 {
     $attributes = $this->apiAttributes();
     //Retrieve the XML dataset
     $orders = $this->getEVEData($walletID);
     $character = Characters::Model()->findByPk($walletID);
     Orders::Model()->deleteAll('charID=:charID', array(':charID' => $character->characterID));
     foreach ($orders->result->rowset->row as $row) {
         $exist = Orders::Model()->exists('orderID=:orderID', array(':orderID' => $row->attributes()->orderID));
         if (!$exist) {
             //echo "ORDERID: {$row->attributes()->orderID} <br>";
             $orderRow = new Orders();
             $orderRow->orderID = $row->attributes()->orderID;
             $orderRow->charID = $row->attributes()->charID;
             $orderRow->stationID = $row->attributes()->stationID;
             $orderRow->volEntered = $row->attributes()->volEntered;
             $orderRow->volRemaining = $row->attributes()->volRemaining;
             $orderRow->minVolume = $row->attributes()->minVolume;
             $orderRow->orderState = $row->attributes()->orderState;
             $orderRow->typeID = $row->attributes()->typeID;
             $orderRow->range = $row->attributes()->range;
             $orderRow->accountKey = $row->attributes()->accountKey;
             $orderRow->duration = $row->attributes()->duration;
             $orderRow->escrow = $row->attributes()->escrow;
             $orderRow->price = $row->attributes()->price;
             $orderRow->bid = $row->attributes()->bid;
             $orderRow->issued = $row->attributes()->issued;
             $orderRow->save();
             //print_r($orderRow->getErrors());
         } else {
             //echo "ORDERID: {$row->attributes()->orderID} <br>";
             $orderRow = Orders::Model()->findByPk($row->attributes()->orderID);
             $orderRow->orderID = $row->attributes()->orderID;
             $orderRow->charID = $row->attributes()->charID;
             $orderRow->stationID = $row->attributes()->stationID;
             $orderRow->volEntered = $row->attributes()->volEntered;
             $orderRow->volRemaining = $row->attributes()->volRemaining;
             $orderRow->minVolume = $row->attributes()->minVolume;
             $orderRow->orderState = $row->attributes()->orderState;
             $orderRow->typeID = $row->attributes()->typeID;
             $orderRow->range = $row->attributes()->range;
             $orderRow->accountKey = $row->attributes()->accountKey;
             $orderRow->duration = $row->attributes()->duration;
             $orderRow->escrow = $row->attributes()->escrow;
             $orderRow->price = $row->attributes()->price;
             $orderRow->bid = $row->attributes()->bid;
             $orderRow->issued = $row->attributes()->issued;
             $orderRow->save();
             //print_r($orderRow->getErrors());
         }
     }
 }
开发者ID:Covert-Inferno,项目名称:prohd,代码行数:52,代码来源:APIOrders.php

示例2: foreach

		<?php 
$topTenItems = $this->getTopTenByProfit();
foreach ($topTenItems as $item) {
    $i++;
    if ($i % 2) {
        echo "<tr class='odd'>";
    } else {
        echo "<tr>";
    }
    $name = $item['typeName'];
    $volume = $item['totalVolume'];
    $profit = $item['totalProfit'];
    $typeID = $item['typeID'];
    $icon = $this->getIcon($typeID);
    //get order data
    $orders = Orders::Model()->find('typeID=:typeID AND orderState = 0 AND charID IN (' . implode(',', $this->getMembersAsCharIDArray(Yii::app()->user->trackingGroupID)) . ')', array(':typeID' => $typeID));
    if (empty($orders)) {
        $orderText = "No Orders";
    } else {
        $orderText = number_format($orders->volRemaining) . "/" . number_format($orders->volEntered) . " (" . floor($orders->volRemaining / $orders->volEntered * 100) . "%)";
    }
    echo '<td><div class="textCenter"><img height="16" width="16" src="./images/items/' . $icon . '"><a href="index.php?r=wallet/item&id=' . $typeID . '">' . $name . '</a></div></td>';
    echo "<td>{$orderText}</td>";
    echo '<td style="text-align: right;"><font color="green">+' . number_format($profit, 0) . '</font></td>';
    echo "</tr>";
}
?>
		</table>
		</div>	
		
	</div>
开发者ID:Covert-Inferno,项目名称:prohd,代码行数:31,代码来源:_indexAjax.php

示例3: getOrderTotal

 public function getOrderTotal($characterID)
 {
     //Get the character information from the db
     $character = Characters::model()->findByPk($characterID);
     $criteria = new CDbCriteria();
     $criteria->condition = 'charID=:characterID AND orderState=0 AND bid=0';
     $criteria->params = array(':characterID' => $character->characterID);
     $orders = Orders::Model()->findAll($criteria);
     foreach ($orders as $order) {
         $orderTotal = $orderTotal + $order->price * $order->volRemaining;
     }
     return $orderTotal;
 }
开发者ID:Covert-Inferno,项目名称:prohd,代码行数:13,代码来源:SellOrdersController.php

示例4: foreach

 echo "</tr>\n";
 $names++;
 $j = 0;
 //Loop through the items
 foreach ($group as $item) {
     $i++;
     $j++;
     if ($j % 2) {
         echo "<tr class='odd'>\n";
     } else {
         echo "<tr>\n";
     }
     //Get the item details
     $itemDetails = Invtypes::Model()->findByPk($item);
     //Get some order information
     $orders = Orders::Model()->find('typeID=:typeID AND orderState = 0', array(':typeID' => $item));
     if (empty($orders)) {
         $orderText = "<font color='#FFA824'>No Orders</font>";
     } else {
         $orderText = number_format($orders->volRemaining) . "/" . number_format($orders->volEntered) . " (" . floor($orders->volRemaining / $orders->volEntered * 100) . "%)";
     }
     //Get profit, volume, and icon information
     $details = $this->getProfitDetails($item);
     $detailsRow = $details->read();
     $profit = number_format($detailsRow['totalProfit']);
     $volume = number_format($detailsRow['totalVolume']);
     $perUnit = number_format($detailsRow['totalProfit'] / $detailsRow['totalVolume'], 0);
     $color = $this->numToColor($profit);
     $icon = $this->getIcon($itemDetails->typeID);
     echo "<td><div class='textCenter'><img height='16' width='16' src='http://image.eveonline.com/Type/{$icon}'> <a href='index.php?r=wallet/item&id={$itemDetails->typeID}'>{$itemDetails->typeName}</a></div></td>\n";
     #echo "<td><div class='textCenter'><img height='16' width='16' src='images/items/$icon'>$itemDetails->typeName</div></td>\n";
开发者ID:Covert-Inferno,项目名称:prohd,代码行数:31,代码来源:index.php


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