diff --git a/application/index/controller/Order.php b/application/index/controller/Order.php index e14f5b766..c3cc54907 100755 --- a/application/index/controller/Order.php +++ b/application/index/controller/Order.php @@ -231,10 +231,19 @@ class Order extends Common */ public function Respond() { - // 获取支付回调数据 + // 参数 $params = input(); - $params['user'] = $this->user; - $ret = OrderService::Respond($params); + + // 是否自定义状态 + if(isset($params['appoint_status'])) + { + $ret = ($params['appoint_status'] == 1) ? DataReturn('支付成功', 0) : DataReturn('支付失败', -100); + + // 获取支付回调数据 + } else { + $params['user'] = $this->user; + $ret = OrderService::Respond($params); + } // 自定义链接 $this->assign('to_url', MyUrl('index/order/index')); diff --git a/application/index/view/default/orderaftersale/aftersale.html b/application/index/view/default/orderaftersale/aftersale.html index 57cec7cca..5f2b5afff 100644 --- a/application/index/view/default/orderaftersale/aftersale.html +++ b/application/index/view/default/orderaftersale/aftersale.html @@ -213,6 +213,10 @@ 退款说明: {{$new_aftersale_data.msg}} +
+ 退款方式: + {{$new_aftersale_data.refundment_text}} +
拒绝原因: {{$new_aftersale_data.refuse_reason}} diff --git a/application/index/view/default/orderaftersale/create.html b/application/index/view/default/orderaftersale/create.html index 755030cc0..96bd07b2c 100644 --- a/application/index/view/default/orderaftersale/create.html +++ b/application/index/view/default/orderaftersale/create.html @@ -16,7 +16,7 @@
- +
diff --git a/application/service/OrderAftersaleService.php b/application/service/OrderAftersaleService.php index cc1e14592..b32c68e94 100644 --- a/application/service/OrderAftersaleService.php +++ b/application/service/OrderAftersaleService.php @@ -839,6 +839,12 @@ class OrderAftersaleService return DataReturn('支付方式有误', -1); } + // 交易平台单号 + if(empty($pay_log['trade_no'])) + { + return DataReturn('平台单号为空,请确认支付日志是否存在', -1); + } + // 操作退款 $pay_name = 'payment\\'.$pay_log['payment']; $pay_params = [ diff --git a/application/service/OrderService.php b/application/service/OrderService.php index f662cd645..566cc17c9 100755 --- a/application/service/OrderService.php +++ b/application/service/OrderService.php @@ -66,10 +66,6 @@ class OrderService { return DataReturn('资源不存在或已被删除', -1); } - if($order['total_price'] <= 0.00) - { - return DataReturn('金额不能为0', -1); - } if($order['status'] != 1) { $status_text = lang('common_order_user_status')[$order['status']]['name']; @@ -90,6 +86,24 @@ class OrderService Db::name('Order')->where(['id'=>$order['id']])->update(['payment_id'=>$payment_id, 'upd_time'=>time()]); } + // 金额为0直接支付成功 + if($order['total_price'] <= 0.00) + { + // 非线上支付处理 + $params['user']['user_name_view'] = '用户-'.$params['user']['user_name_view']; + $pay_result = self::OrderPaymentUnderLine([ + 'order' => $order, + 'payment' => $payment[0], + 'user' => $params['user'], + 'subject' => $params, + ]); + if($pay_result['code'] == 0) + { + return DataReturn('支付成功', 0, ['data'=>MyUrl('index/order/respond', ['appoint_status'=>1])]); + } + return $pay_result; + } + // 支付入口文件检查 $pay_checked = PaymentService::EntranceFileChecked($payment[0]['payment'], 'order'); if($pay_checked['code'] != 0) @@ -203,10 +217,6 @@ class OrderService { return DataReturn('资源不存在或已被删除', -1); } - if($order['total_price'] <= 0.00) - { - return DataReturn('金额不能为0', -1); - } if($order['status'] != 1) { $status_text = lang('common_order_admin_status')[$order['status']]['name']; @@ -242,7 +252,7 @@ class OrderService { if(!empty($params['order']) && !empty($params['payment']) && !empty($params['user'])) { - if(in_array($params['payment']['payment'], config('shopxo.under_line_list'))) + if(in_array($params['payment']['payment'], config('shopxo.under_line_list')) || $params['order']['total_price'] <= 0.00) { // 支付处理 $pay_params = [ @@ -256,6 +266,8 @@ class OrderService ], ]; return self::OrderPayHandle($pay_params); + } else { + return DataReturn('仅线下支付方式处理', -1); } } return DataReturn('无需处理', 0); diff --git a/application/tags.php b/application/tags.php index eb975ead0..d699e8414 100755 --- a/application/tags.php +++ b/application/tags.php @@ -114,6 +114,11 @@ return array ( 0 => 'app\\plugins\\touristbuy\\Hook', 1 => 'app\\plugins\\weixinwebauthorization\\Hook', ), + 'plugins_service_buy_handle' => + array ( + 0 => 'app\\plugins\\newuserreduction\\Hook', + 1 => 'app\\plugins\\membershiplevel\\Hook', + ), 'plugins_view_goods_detail_photo_bottom' => array ( 0 => 'app\\plugins\\share\\Hook', @@ -134,10 +139,6 @@ return array ( array ( 0 => 'app\\plugins\\membershiplevel\\Hook', ), - 'plugins_service_buy_handle' => - array ( - 0 => 'app\\plugins\\membershiplevel\\Hook', - ), 'plugins_service_user_login_success_record' => array ( 0 => 'app\\plugins\\membershiplevel\\Hook',