当前位置: 首页>>代码示例>>PHP>>正文


PHP payment::updateOrder方法代码示例

本文整理汇总了PHP中payment::updateOrder方法的典型用法代码示例。如果您正苦于以下问题:PHP payment::updateOrder方法的具体用法?PHP payment::updateOrder怎么用?PHP payment::updateOrder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在payment的用法示例。


在下文中一共展示了payment::updateOrder方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: order_collection_doc

 public function order_collection_doc()
 {
     //获得订单号
     $order_no = IFilter::act(IReq::get('order_no'));
     $text = "<br /><div align='center'>付款已完成</div>";
     if (payment::updateOrder($order_no)) {
         //获得collection_doc表的对象
         $tb_collection_doc = new IModel('collection_doc');
         $tb_collection_doc->setData(array('order_id' => IFilter::act(IReq::get('id'), 'int'), 'user_id' => IFilter::act(IReq::get('user_id'), 'int'), 'payment_id' => IFilter::act(IReq::get('payment_id'), 'int'), 'collection_account' => IFilter::act(IReq::get('collection_account')), 'time' => date('Y-m-d H:i:s'), 'amount' => IFilter::act(IReq::get('amount'), 'float'), 'note' => IFilter::act(IReq::get('note'), 'text'), 'pay_status' => 1, 'if_del' => 0));
         $tb_collection_doc->add();
         //生成订单日志
         $tb_order_log = new IModel('order_log');
         $tb_order_log->setData(array('order_id' => IFilter::act(IReq::get('id'), 'int'), 'user' => $this->admin['admin_id'], 'action' => '付款', 'result' => '成功', 'note' => '订单【' . $order_no . '】付款' . IFilter::act(IReq::get('amount'), 'float'), 'addtime' => date('Y-m-d H:i:s')));
         $tb_order_log->add();
         $logObj = new log('db');
         $logObj->write('operation', array("管理员:" . ISafe::get('admin_name'), "订单更新为已付款", "订单号:" . $order_no . ',已经确定付款'));
     } else {
         $text = "<br /><div align='center'>付款失败</div>";
     }
     echo $text;
     exit;
 }
开发者ID:chenyongze,项目名称:iwebshop,代码行数:22,代码来源:order.php

示例2: server_callback

 function server_callback()
 {
     $payment_name = is_array($payment_name = IReq::get('payment_name')) ? IFilter::act($payment_name[0]) : IFilter::act(IReq::get('payment_name'));
     //初始化参数
     $money = null;
     $message = null;
     $tradeno = null;
     //获取支付payment的id值
     $pObj = new IModel('payment as a,pay_plugin as b');
     $paymentRow = $pObj->getObj('b.file_path = "' . $payment_name . '" and a.plugin_id = b.id', 'a.id');
     //载入支付接口文件
     $paymentObj = new Payment();
     $payObj = $paymentObj->loadMethod($payment_name);
     if (!is_object($payObj)) {
         echo 'fail';
         exit;
     }
     //执行接口回调函数
     $return = $payObj->serverCallback(array_merge($_POST, $_GET), $paymentRow['id'], $money, $message, $tradeno);
     //判断返回状态
     if ($return == 1) {
         if (stripos($tradeno, 'recharge_') !== false) {
             $tradenoArray = explode('_', $tradeno);
             $recharge_no = isset($tradenoArray[1]) ? $tradenoArray[1] : 0;
             if (payment::updateRecharge($recharge_no)) {
                 echo 'success';
                 exit;
             } else {
                 echo 'fail';
             }
         } else {
             if (payment::updateOrder($tradeno)) {
                 echo 'success';
                 exit;
             } else {
                 echo 'fail';
             }
         }
     } else {
         echo 'fail';
     }
 }
开发者ID:chenyongze,项目名称:iwebshop,代码行数:42,代码来源:block.php

示例3: cart3


//.........这里部分代码省略.........
     $dataArray = array('order_no' => $order_no, 'user_id' => $user_id, 'accept_name' => $accept_name, 'pay_type' => $payment, 'distribution' => $delivery_id, 'status' => 1, 'pay_status' => 0, 'distribution_status' => 0, 'postcode' => $zip, 'telphone' => $telphone, 'province' => $province, 'city' => $city, 'area' => $area, 'address' => $address, 'mobile' => $mobile, 'create_time' => ITime::getDateTime(), 'invoice' => $is_tax, 'postscript' => $order_message, 'invoice_title' => $tax_title, 'accept_time' => $accept_time, 'exp' => $exp_r, 'point' => $point_r, 'type' => $order_type, 'prop' => isset($dataArray['prop']) ? $dataArray['prop'] : null, 'payable_amount' => $goodsResult['sum'], 'real_amount' => $goodsResult['final_sum'], 'payable_freight' => $deliveryPrice, 'real_freight' => $deliveryPrice_r, 'pay_fee' => $payment_fee, 'taxes' => $tax, 'promotions' => $proReduce_r + $reduce_r, 'order_amount' => $order_amount, 'if_insured' => $if_insured, 'insured' => $protect_price);
     $orderObj = new IModel('order');
     $orderObj->setData($dataArray);
     $this->order_id = $orderObj->add();
     if ($this->order_id == false) {
         IError::show(403, '订单生成错误');
     }
     /*将订单中的商品插入到order_goods表*/
     $orderGoodsObj = new IModel('order_goods');
     $goodsArray = array('order_id' => $this->order_id);
     $findType = array('goods' => 'goodsList', 'product' => 'productList');
     foreach ($findType as $key => $list) {
         if (isset($goodsResult[$list]) && count($goodsResult[$list]) > 0) {
             foreach ($goodsResult[$list] as $k => $val) {
                 //拼接商品名称和规格数据
                 $specArray = array('name' => $val['name'], 'value' => '');
                 if ($key == 'product') {
                     $goodsArray['product_id'] = $val['id'];
                     $goodsArray['goods_id'] = $val['goods_id'];
                     $spec = block::show_spec($val['spec_array']);
                     foreach ($spec as $skey => $svalue) {
                         $specArray['value'] .= $skey . ':' . $svalue . ' , ';
                     }
                 } else {
                     $goodsArray['goods_id'] = $val['id'];
                     $goodsArray['product_id'] = 0;
                 }
                 $specArray = serialize($specArray);
                 $goodsArray['goods_price'] = $val['sell_price'];
                 $goodsArray['real_price'] = $val['sell_price'] - $val['reduce'];
                 $goodsArray['goods_nums'] = $val['count'];
                 $goodsArray['goods_weight'] = $val['weight'];
                 $goodsArray['goods_array'] = $specArray;
                 $orderGoodsObj->setData($goodsArray);
                 $orderGoodsObj->add();
             }
         }
     }
     //更改购买商品的库存数量
     Block::updateStore($this->order_id, 'reduce');
     //记录用户默认习惯的数据
     if (!isset($memberRow['custom'])) {
         $memberObj = new IModel('member');
         $memberRow = $memberObj->getObj('user_id = ' . $user_id, 'custom');
     }
     $memberData = array('custom' => serialize(array('payment' => $payment, 'delivery' => $delivery_id)));
     $memberObj->setData($memberData);
     $memberObj->update('user_id = ' . $user_id);
     //收货地址的处理
     if ($user_id) {
         $addressObj = new IModel('address');
         //如果用户之前没有收货地址,那么会自动记录此次的地址信息并且为默认
         $addressRow = $addressObj->getObj('user_id = ' . $user_id);
         if (empty($addressRow)) {
             $addressData = array('default' => '1', 'user_id' => $user_id, 'accept_name' => $accept_name, 'province' => $province, 'city' => $city, 'area' => $area, 'address' => $address, 'zip' => $zip, 'telphone' => $telphone, 'mobile' => $mobile);
             $addressObj->setData($addressData);
             $addressObj->add();
         } else {
             //如果用户有收货地址,但是没有设置默认项,那么会自动设置此次地址信息为默认
             $radio_address = intval(IReq::get('radio_address'));
             if ($radio_address != 0) {
                 $addressDefRow = $addressObj->getObj('user_id = ' . $user_id . ' and `default` = 1');
                 if (empty($addressDefRow)) {
                     $addressData = array('default' => 1);
                     $addressObj->setData($addressData);
                     $addressObj->update('user_id = ' . $user_id . ' and id = ' . $radio_address);
                 }
             }
         }
     }
     //获取备货时间
     $siteConfigObj = new Config("site_config");
     $site_config = $siteConfigObj->getInfo();
     $this->stockup_time = isset($site_config['stockup_time']) ? $site_config['stockup_time'] : 2;
     //数据渲染
     $this->order_num = $dataArray['order_no'];
     $this->final_sum = $dataArray['order_amount'];
     $this->payment_fee = $payment_fee;
     $this->payment = $paymentName;
     $this->delivery = $deliveryList[$delivery_id]['name'];
     $this->tax_title = $tax_title;
     $this->deliveryType = $deliveryRow['type'];
     $this->paymentType = $paymentType;
     $this->paymentNote = $paymentNote;
     //订单金额为0时,订单自动完成
     if ($this->final_sum <= 0) {
         $order_id = payment::updateOrder($dataArray['order_no']);
         if ($order_id != '') {
             if ($user_id) {
                 $this->redirect('/site/success/message/' . urlencode("订单确认成功,等待发货") . '/?callback=ucenter/order_detail/id/' . $order_id);
             } else {
                 $this->redirect('/site/success/message/' . urlencode("订单确认成功,等待发货"));
             }
         } else {
             IError::show(403, '订单修改失败');
         }
     } else {
         $this->redirect('cart3');
     }
 }
开发者ID:chenyongze,项目名称:iwebshop,代码行数:101,代码来源:simple.php


注:本文中的payment::updateOrder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。