当前位置: 首页>>代码示例>>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;未经允许,请勿转载。