本文整理匯總了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);
}
示例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
示例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);
}