當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Price::current方法代碼示例

本文整理匯總了PHP中Price::current方法的典型用法代碼示例。如果您正苦於以下問題:PHP Price::current方法的具體用法?PHP Price::current怎麽用?PHP Price::current使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Price的用法示例。


在下文中一共展示了Price::current方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: estimatePrice

 public function estimatePrice($opts = array())
 {
     extract($opts);
     $info = $this->info();
     if (!isset($material)) {
         $material = reset(json_decode($info['material']));
     }
     $price = $info['weight'] * (1 + Setting::get('wear_tear')) * Price::current($material) * ($material === 'PT950' ? Setting::get('weight_ratio') : 1) + Setting::get('labor_expense') + $info['small_stone'] * (Setting::get('st_expense') + Setting::get('st_price'));
     return round($price, 2);
 }
開發者ID:name3,項目名稱:cheng,代碼行數:10,代碼來源:Product.php

示例2: exit

<?php

!defined('IN_PTF') && exit('ILLEGAL EXECUTION');
?>
<div class="small-wrap">
    <div class="gold-price">
        <span class="lbl">今日金價</span>
        <span class="info">PT950: <?php 
echo fp(Price::current('PT950'));
?>
元/克</span>
        <span class="info">AU750: <?php 
echo fp(Price::current('AU750'));
?>
元/克</span>
    </div>
    <div class="account">
        <?php 
if ($has_login) {
    ?>
            <?php 
    if ($user_type === 'Customer') {
        ?>
                <span class="welcom">你好,<?php 
        echo htmlentities($user->name);
        ?>
</span>
                <?php 
        if ($user_type === 'Customer') {
            ?>
                    <a class="cart" href="<?php 
開發者ID:name3,項目名稱:cheng,代碼行數:31,代碼來源:header.php

示例3: submit

 public function submit()
 {
     $this->info = $this->info();
     // why here?
     $material = $this->info['material'];
     $product = $this->product();
     $info = array('small_stone' => $product->small_stone, 'gold_price' => Price::current($material), 'labor_expense' => Setting::get('labor_expense'), 'wear_tear' => Setting::get('wear_tear'), 'st_price' => Setting::get('st_price'), 'st_expense' => Setting::get('st_expense'), 'st_weight' => $product->st_weight, 'model_expense' => 0, 'risk_expense' => Setting::get('risk_expense'));
     $factory_price = PriceData::create($info);
     $customer_price = PriceData::create($info);
     Pdb::update(array('state' => 'ToBeConfirmed', 'submit_time=NOW()' => null, 'factory_price' => $factory_price->id, 'customer_price' => $customer_price->id, 'real_price' => $this->info['estimate_price'], 'weight_ratio' => $material === 'PT950' ? Setting::get('weight_ratio') : 1), self::$table, $this->selfCond());
     $customer = $this->customer();
     Pdb::insert(array('subject' => $customer->id, 'action' => 'SubmitOrder', 'target' => $this->id, 'time=NOW()' => null, 'info' => $customer->user()->realname . ' 提交訂單'), UserLog::$table);
 }
開發者ID:name3,項目名稱:cheng,代碼行數:13,代碼來源:Order.php


注:本文中的Price::current方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。