Esempio n. 1
0
 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);
 }
Esempio n. 2
0
<?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 
Esempio n. 3
0
 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);
 }