} } else { $this->error('购物车里没有任何商品!'); } //订单名称 $subject = mc_option('site_name') . '订单'; //必填 //付款金额 if (mc_total() < mc_option('m_youfei')) { $mc_total = mc_total() + mc_option('youfei'); } else { $mc_total = mc_total(); } if (I('param.coins') > 0 && I('param.coins') <= mc_coins(mc_user_id())) { //积分需大于0,且小于等于现有积分 $coins_topthis = mc_total() * 50; if (I('param.coins') > $coins_topthis) { $mc_total2 = $mc_total; } else { $mc_total2 = $mc_total - I('param.coins') / 100; } } else { $mc_total2 = $mc_total; } $price = $mc_total2; //必填 //商品数量 $quantity = "1"; //必填,建议默认为1,不改变值,把一次交易看成是一次下订单而非购买一件商品 //物流费用 $logistics_fee = "0.00";
echo U('home/perform/cart_delete?id=' . $val['id']); ?> ">删除</a> </div> </th> </tr> </tbody> <?php } ?> </table> <div class="panel-footer"> <div class="row"> <div class="col-xs-6"> <div class="btn btn-link" id="total">商品总价:<span><?php echo mc_total(); ?> </span> 元</div> </div> <div class="col-xs-6 text-right"> <a href="<?php echo U('pro/cart/checkout'); ?> " class="btn btn-warning"> <i class="glyphicon glyphicon-circle-arrow-right"></i> 下一步 </a> </div> </div> </div> <?php } else {
M('action')->where("user_id='" . mc_user_id() . "' AND action_key='trade_pending'")->delete(); //mc_add_action(mc_user_id(),'address_pending','<h5>'.$_POST['buyer_name'].'</h5><p>'.$_POST['buyer_province'].'</p><p>'.$_POST['buyer_city'].'</p><p>'.$_POST['buyer_address'].'</p><p>'.$_POST['buyer_phone'].'</p>'); //mc_add_action(mc_user_id(),'out_trade_no',$out_trade_no); $action['page_id'] = mc_user_id(); $action['user_id'] = mc_user_id(); $action['action_key'] = 'address_pending'; $action['action_value'] = '<h4>' . I('param.buyer_name') . '</h4><p>' . I('param.buyer_province') . ',' . I('param.buyer_city') . ',' . I('param.buyer_address') . '</p><p>' . I('param.buyer_phone') . '</p>'; M('action')->data($action)->add(); $action['action_key'] = 'trade_pending'; $action['action_value'] = $out_trade_no; M('action')->data($action)->add(); } else { $this->error('购物车里没有任何商品!'); } //付款金额 $qqprice = mc_total(); $qqtransport_fee = 0.0; //$_REQUEST["WIDlogistics_fee"]; $total_fee = $qqprice + $qqtransport_fee; $bank_type = $_REQUEST["bank_type"]; require_once "classes/RequestHandler.class.php"; require_once "tenpay_config.php"; $curDateTime = date("YmdHis"); //date_default_timezone_set(PRC); $strDate = date("Ymd"); $strTime = date("His"); //4位随机数 $randNum = rand(1000, 9999); //10位序列号,可以自行调整。 $strReq = $strTime . $randNum; /* 商家的定单号 */