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


PHP order_refund函数代码示例

本文整理汇总了PHP中order_refund函数的典型用法代码示例。如果您正苦于以下问题:PHP order_refund函数的具体用法?PHP order_refund怎么用?PHP order_refund使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: refund

 /**
  * 退款
  * 在查看订单详情页面进行退款处理
  * 需提交参数,
  * 		退款订单ID(order_id)
  * 		退款金额(refund_price)
  * 		操作用户ID(member_id)
  * @author						李东
  * @date						2015-06-23
  */
 public function refund()
 {
     if (IS_POST) {
         $id = I('post.id');
         $refund_price = I('post.refund_price');
         if (!$id) {
             $this->error('操作失败');
         }
         if (!$refund_price) {
             $this->error('请填写退款金额');
         }
         $username = session('username');
         $description = "管理员({$username})强制退款";
         $status = order_refund($id, $refund_price, $description);
         if ($status) {
             $this->success('操作成功!', U('index'));
         } else {
             $this->error('操作失败');
         }
     } else {
         $this->error('提交错误');
     }
 }
开发者ID:976112643,项目名称:manor,代码行数:33,代码来源:ExpiredController.class.php

示例2: return_user_surplus_integral_bonus

     return_user_surplus_integral_bonus($order);
 } elseif ('return' == $operation) {
     /* 定义当前时间 */
     define('GMTIME_UTC', gmtime());
     // 获取 UTC 时间戳
     /* 过滤数据 */
     $_REQUEST['refund'] = isset($_REQUEST['refund']) ? $_REQUEST['refund'] : '';
     $_REQUEST['refund_note'] = isset($_REQUEST['refund_note']) ? $_REQUEST['refund'] : '';
     /* 标记订单为“退货”、“未付款”、“未发货” */
     $arr = array('order_status' => OS_RETURNED, 'pay_status' => PS_UNPAYED, 'shipping_status' => SS_UNSHIPPED, 'money_paid' => 0, 'invoice_no' => '', 'order_amount' => $order['money_paid']);
     update_order($order_id, $arr);
     /* todo 处理退款 */
     if ($order['pay_status'] != PS_UNPAYED) {
         $refund_type = $_REQUEST['refund'];
         $refund_note = $_REQUEST['refund'];
         order_refund($order, $refund_type, $refund_note);
     }
     /* 记录log */
     order_action($order['order_sn'], OS_RETURNED, SS_UNSHIPPED, PS_UNPAYED, $action_note);
     /* 如果订单用户不为空,计算积分,并退回 */
     if ($order['user_id'] > 0) {
         /* 取得用户信息 */
         $user = user_info($order['user_id']);
         $sql = "SELECT  goods_number, send_number FROM" . $GLOBALS['ecs']->table('order_goods') . "\n                WHERE order_id = '" . $order['order_id'] . "'";
         $goods_num = $db->query($sql);
         $goods_num = $db->fetchRow($goods_num);
         if ($goods_num['goods_number'] == $goods_num['send_number']) {
             /* 计算并退回积分 */
             $integral = integral_to_give($order);
             log_account_change($order['user_id'], 0, 0, -1 * intval($integral['rank_points']), -1 * intval($integral['custom_points']), sprintf($_LANG['return_order_gift_integral'], $order['order_sn']));
         }
开发者ID:norain2050,项目名称:benhu,代码行数:31,代码来源:order.php

示例3: while

         $sql = "SELECT * " . "FROM " . $ecs->table('order_info') . " WHERE extension_code = 'group_buy' " . "AND extension_id = '{$group_buy_id}' " . "AND (order_status = '" . OS_CONFIRMED . "' OR order_status = '" . OS_UNCONFIRMED . "') ";
         $res = $db->query($sql);
         while ($order = $db->fetchRow($res)) {
             // 修改订单状态为已取消,付款状态为未付款
             $order['order_status'] = OS_CANCELED;
             $order['to_buyer'] = $_LANG['cancel_order_reason'];
             $order['pay_status'] = PS_UNPAYED;
             $order['pay_time'] = 0;
             /* 如果使用余额或有已付款金额,退回帐户余额 */
             $money = $order['surplus'] + $order['money_paid'];
             if ($money > 0) {
                 $order['surplus'] = 0;
                 $order['money_paid'] = 0;
                 $order['order_amount'] = $money;
                 // 退款到帐户余额
                 order_refund($order, 1, $_LANG['cancel_order_reason'] . ':' . $order['order_sn'], $money);
             }
             /* 更新订单 */
             $order = addslashes_deep($order);
             update_order($order['order_id'], $order);
         }
     }
     /* 修改团购活动状态为失败,记录失败原因(活动说明) */
     $sql = "UPDATE " . $ecs->table('goods_activity') . " SET is_finished = '" . GBS_FAIL . "', " . "act_desc = '{$_POST['act_desc']}' " . "WHERE act_id = '{$group_buy_id}' LIMIT 1";
     $db->query($sql);
     /* 清除缓存 */
     clear_cache_files();
     /* 提示信息 */
     $links = array(array('href' => 'group_buy.php?act=list', 'text' => $_LANG['back_list']));
     sys_msg($_LANG['edit_success'], 0, $links);
 } elseif (isset($_POST['mail'])) {
开发者ID:BGCX261,项目名称:zishashop-svn-to-git,代码行数:31,代码来源:group_buy.php

示例4: action_insert_update


//.........这里部分代码省略.........
                    $order['order_amount'] += $order['pay_fee'];
                    // 计算付款状态
                    if ($order['order_amount'] > 0) {
                        $order['pay_status'] = PS_UNPAYED;
                        $order['pay_time'] = 0;
                    } else {
                        $order['pay_status'] = PS_PAYED;
                        $order['pay_time'] = gmtime();
                    }
                    // 如果需要退款,退到帐户余额
                    if ($order['order_amount'] < 0) {
                        // todo (现在手工退款)
                    }
                    // 订单状态
                    $order['order_status'] = OS_CONFIRMED;
                    $order['confirm_time'] = gmtime();
                    // 更新订单
                    $order = addslashes_deep($order);
                    update_order($order_id, $order);
                } else {
                    /* 无效,取消订单,退回已付款 */
                    // 修改订单状态为已取消,付款状态为未付款
                    $order['order_status'] = OS_CANCELED;
                    $order['to_buyer'] = $_LANG['cancel_order_reason'];
                    $order['pay_status'] = PS_UNPAYED;
                    $order['pay_time'] = 0;
                    /* 如果使用余额或有已付款金额,退回帐户余额 */
                    $money = $order['surplus'] + $order['money_paid'];
                    if ($money > 0) {
                        $order['surplus'] = 0;
                        $order['money_paid'] = 0;
                        $order['order_amount'] = $money;
                        // 退款到帐户余额
                        order_refund($order, 1, $_LANG['cancel_order_reason'] . ':' . $order['order_sn']);
                    }
                    /* 更新订单 */
                    $order = addslashes_deep($order);
                    update_order($order['order_id'], $order);
                }
            }
        }
        /* 修改预售活动状态为成功 */
        $sql = "UPDATE " . $ecs->table('goods_activity') . " SET is_finished = '" . PSS_SUCCEED . "' " . "WHERE act_id = '{$pre_sale_id}' LIMIT 1";
        $db->query($sql);
        /* 清除缓存 */
        clear_cache_files();
        /* 提示信息 */
        $links = array(array('href' => 'pre_sale.php?act=list', 'text' => $_LANG['back_list']));
        sys_msg($_LANG['edit_success'], 0, $links);
    } elseif (isset($_POST['fail'])) {
        /* 设置活动失败 */
        /* 判断订单状态 */
        if ($pre_sale['status'] != PSS_FINISHED) {
            sys_msg($_LANG['error_status'], 1);
        }
        /* 如果有有效订单,取消订单 */
        if ($pre_sale['valid_order'] > 0) {
            /* 查找未确认或已确认的订单 */
            $sql = "SELECT * " . "FROM " . $ecs->table('order_info') . " WHERE extension_code = '" . PRE_SALE_CODE . "' " . "AND extension_id = '{$pre_sale_id}' " . "AND (order_status = '" . OS_CONFIRMED . "' OR order_status = '" . OS_UNCONFIRMED . "') ";
            $res = $db->query($sql);
            while ($order = $db->fetchRow($res)) {
                // 修改订单状态为已取消,付款状态为未付款
                $order['order_status'] = OS_CANCELED;
                $order['to_buyer'] = $_LANG['cancel_order_reason'];
                $order['pay_status'] = PS_UNPAYED;
                $order['pay_time'] = 0;
开发者ID:seanguo166,项目名称:yinoos,代码行数:67,代码来源:pre_sale.php

示例5: refund

 /**
  * 退款
  * 在查看订单详情页面进行退款处理
  * 需提交参数,
  * 		退款订单ID(order_id)
  * 		退款金额(refund_price)
  * 		操作用户ID(member_id)
  * @author						李东
  * @date						2015-06-30
  */
 public function refund()
 {
     if (IS_POST) {
         $posts = I('post.');
         $id = $posts['order_id'];
         $refund_price = $posts['refund_price'];
         $member_id = session('home_member_id');
         $deal_password = $posts['deal_password'];
         if (!$id) {
             $result = array('status' => '0', 'msg' => '操作失败');
             goto export;
         }
         if (!floatval($refund_price)) {
             $result = array('status' => '0', 'msg' => '请填写退款金额');
             goto export;
         }
         if (!$member_id) {
             $result = array('status' => '0', 'msg' => '请登录后再操作');
             goto export;
         }
         $member_info = get_info('member', array('id' => $member_id));
         if (md5(md5($deal_password)) != $member_info['deal_password']) {
             $result = array('status' => '0', 'msg' => '支付密码不正确');
             goto export;
         }
         $description = "商家同意退款";
         $result = order_refund($id, floatval($refund_price), $description);
         export:
         if ($result['status'] == 1) {
             $this->success($result['msg'], U('index'));
         } else {
             $this->error($result['msg']);
         }
     } else {
         $this->error('请求错误!');
     }
 }
开发者ID:976112643,项目名称:manor,代码行数:47,代码来源:OrderController.class.php


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