From 36eccdb4e623ce69d4871fb64026a14e740eaeea Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Sat, 4 Dec 2021 20:36:20 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=B0=E9=87=91=E6=94=AF=E4=BB=98=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E6=94=AF=E6=8C=81=E6=89=8B=E6=9C=BA+=E7=BB=86?= =?UTF-8?q?=E8=8A=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common.php | 1 - app/service/OrderService.php | 2 +- extend/payment/CashPayment.php | 88 ++++++++++++++++------------------ 3 files changed, 43 insertions(+), 48 deletions(-) diff --git a/app/common.php b/app/common.php index 93f519ee7..ee2817d0a 100755 --- a/app/common.php +++ b/app/common.php @@ -1186,7 +1186,6 @@ function HexToRgb($hex_color) { 'b' => hexdec(substr($color, 4, 2)) ]; } else { - $color = $hex_color; $r = substr($color, 0, 1) . substr($color, 0, 1); $g = substr($color, 1, 1) . substr($color, 1, 1); $b = substr($color, 2, 1) . substr($color, 2, 1); diff --git a/app/service/OrderService.php b/app/service/OrderService.php index e755e1703..b180e2c3a 100755 --- a/app/service/OrderService.php +++ b/app/service/OrderService.php @@ -356,7 +356,7 @@ class OrderService return $ret; } - return DataReturn(empty($ret['msg']) ? '支付接口异常' : $ret['msg'], -1); + return DataReturn(empty($ret['msg']) ? '支付接口异常' : $ret['msg'], isset($ret['code']) ? $ret['code'] : -1, isset($ret['data']) ? $ret['data'] : ''); } /** diff --git a/extend/payment/CashPayment.php b/extend/payment/CashPayment.php index 948a4df6c..806cab663 100755 --- a/extend/payment/CashPayment.php +++ b/extend/payment/CashPayment.php @@ -124,77 +124,73 @@ class CashPayment // 是否开启了自定义支付信息 if(!empty($this->config) && isset($this->config['is_custom_pay']) && $this->config['is_custom_pay'] == 1) { - $html = ' - - - - 支付信息 - - - -

按照以下支付信息进行打款

-
'; + if(APPLICATION == 'web') + { + $h1_margin = '50px;'; + $margin = '50px;'; + $padding = '30px;'; + $radius = '2px;'; + } else { + $h1_margin = '10px;'; + $margin = '20px;'; + $padding = '10px;'; + $radius = '10px;'; + } + $html = '

按照以下支付信息进行打款

+
'; // 文本信息 if(!empty($this->config['content'])) { - $html .= '
    '; + $html .= '
      '; $content = explode("\n", $this->config['content']); - foreach($content as $v) + foreach($content as $k=>$v) { - $html .= '
    • '.$v.'
    • '; + $temp_style = ($k > 0) ? 'border-top: 1px solid #f2f2f2;' : ''; + $html .= '
    • '.$v.'
    • '; } $html .= '
    '; } // 支付金额 - $html .= '

    打款金额:¥'.$params['total_price'].'

    '; + $html .= '

    打款金额:¥'.$params['total_price'].'

    '; + + // 备注 + $html .= '

    打款备注:'.$params['order_no'].'

    '; // 订单关闭提示 $order_close_time = time()+((MyC('common_order_close_limit_time', 30, true)-5)*60); - $html .= '

    订单预计[ '.date('m月d号H点i分', $order_close_time).' ]自动关闭、请尽快完成支付,打款备注:'.$params['order_no'].'

    '; + $html .= '

    订单预计[ '.date('m月d号H点i分', $order_close_time).' ]自动关闭、请尽快完成支付!

    '; // 特别提示文字 if(!empty($this->config['tips'])) { - $html .= '

    '.$this->config['tips'].'

    '; + $html .= '

    '.$this->config['tips'].'

    '; } // 图片信息 if(!empty($this->config['images_url'])) { - $html .= '支付信息'; + $html .= '
    支付信息
    '; } // 导航入口 - $home_url = __MY_URL__; - $order_url = MyUrl('index/order/index'); - $html .= ''; - - $html .= '
- - '; + if(APPLICATION == 'web') + { + $home_url = __MY_URL__; + $order_url = MyUrl('index/order/index'); + $html .= '
回到首页进入我的订单
'; + $html .= '
'; + } - die($html); + // app则返回固定错误码和html代码、返回固定错误码 + if(APPLICATION == 'app') + { + return DataReturn('success', -6666, $html); + } + + // web端直接输出html + die('支付信息'.$html.''); } // 默认方式 @@ -202,7 +198,7 @@ class CashPayment $url .= 'out_trade_no='.$params['order_no']; $url .= '&subject='.$params['name']; $url .= '&total_price='.$params['total_price']; - return DataReturn('处理成功', 0, $url); + return DataReturn('success', 0, $url); } /** @@ -216,7 +212,7 @@ class CashPayment */ public function Respond($params = []) { - return DataReturn('处理成功', 0, $params); + return DataReturn('success', 0, $params); } } ?> \ No newline at end of file