示例#1
0
文件: delivery.php 项目: zwq/unpei
                        </div>

                        <?php 
            //$ship += $list['ShipCost'] * $list['Quantity'];
            ?>
        <?php 
        }
        ?>
                        <?php 
    }
    ?>
                <div class="sumtotal2 m-top" style="">
                    <div style="text-align:left;line-height: 20px; float: right">
                        <?php 
    $organID = Yii::app()->user->getOrganID();
    $data = BuyGoodsService::activeorgan();
    $params = array();
    if (in_array($organID, $data)) {
        $act = BuyGoodsService::active();
        $payment = !empty($_GET['payment']) ? $_GET['payment'] + 1 : '2';
    }
    $cha = $totals - $counts;
    $cha = sprintf("%.2f", $cha);
    if ($cha != 0) {
        ?>
                            应付金额:<b><span style="color:#E97816;font-size:16px">
                                    <s style="color:#E97816;font-size:16px">¥<?php 
        echo sprintf("%.2f", $totals);
        ?>
</s>
                                </span>
示例#2
0
 public function actionGetaction()
 {
     $html = '';
     $order_decr = 0;
     $cop_amout = Yii::app()->request->getParam(cop_amout);
     $organID = Yii::app()->user->getOrganID();
     $data = BuyGoodsService::activeorgan();
     //        var_dump($data);die;
     $params = array();
     if (in_array($organID, $data)) {
         $act = BuyGoodsService::active();
         if (!empty($act) && is_array($act)) {
             $payment = $act['Payment'];
             $params['PromoID'] = intval($act['ID']);
             $params['TotalAmount'] = Yii::app()->request->getParam('amount');
             switch ($act['Type']) {
                 case 1:
                     //满多少减多少
                     $act_res = BuyGoodsService::decre($params);
                     if (!empty($act_res) && is_array($act_res)) {
                         if (!empty($act_res['DecrAmount'])) {
                             $html = "<span style='color:red'>优惠:-¥" . $act_res['DecrAmount'] . "(单笔订单满 ¥" . $act_res['MinAmount'] . " 减¥" . $act_res['DecrAmount'] . ")</span>";
                         } else {
                             $html = '';
                         }
                     }
                     $order_decr = $act_res['DecrAmount'];
                     break;
                 case 2:
                     //每满减
                     $act_res = BuyGoodsService::pperdecre($params);
                     $order_decr = $act_res['DecrTotal'];
                     if (!empty($act_res['DecrAmount'])) {
                         $html = "<span style='color:red'>优惠:-" . $act_res['DecrTotal'] . "(单笔订单每满 ¥" . $act_res['MinAmount'] . " 减¥" . $act_res['DecrAmount'] . ")</span>";
                     }
                     break;
                 case 3:
                     //优惠券
                     $params['search'] = 'search';
                     $res = BuyGoodsService::mycoupon();
                     $act_res = BuyGoodsService::coupondecre($params);
                     $coupon = $res->getData();
                     $html = "";
                     // "<span style='color:red'>单笔订单满" . $act_res['MinAmount'] . "元,系统将赠送您价值" . $act_res['DecrAmount'] . "元优惠券" . $act_res['Num'] . "张</span><br>";
                     if ($cop_amout) {
                         $html .= '<span style="color:red">使用优惠券:-¥' . floatval($cop_amout);
                     } elseif (!empty($coupon) && is_array($coupon)) {
                         $html .= "<span class='cup' style='color:red'><span class='payper' style='color:blue'>使用我的优惠券</span>(您可以使用优惠券,减免订单金额,每次只限一张)</span>";
                     }
                     break;
             }
         }
     }
     echo json_encode(array('html' => $html, 'order_decr' => $order_decr, 'payment' => isset($payment) ? $payment - 1 : '1'));
 }