From 5979814ba42ca1796f517662de1e19f6736a1182 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Sun, 9 Jan 2022 00:06:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=8F=90=E4=BA=A4=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/Order.php | 2 +- app/service/BuyService.php | 5 ++--- app/service/OrderService.php | 13 ++++++------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/app/admin/controller/Order.php b/app/admin/controller/Order.php index 2698afc30..69a7a1a68 100755 --- a/app/admin/controller/Order.php +++ b/app/admin/controller/Order.php @@ -269,7 +269,7 @@ class Order extends Common { $params = $this->data_request; $params['admin'] = $this->admin; - return OrderService::AdminPay($params); + return OrderService::OrderPaymentUnderLinePay($params); } } ?> \ No newline at end of file diff --git a/app/service/BuyService.php b/app/service/BuyService.php index 00c3d8001..ca5bc5953 100755 --- a/app/service/BuyService.php +++ b/app/service/BuyService.php @@ -921,9 +921,8 @@ class BuyService // 商品总数 $count = count($params['goods']); - // 提交订单则需要存在多个商品的时候校验 - // 是否需要校验商品类型 - $is_check_goods_site_type = (!isset($params['is_buy']) || $params['is_buy'] != 1 || ($count > 1 && $params['is_buy'] == 1)); + // 是否需要校验商品类型、is_buy指定需要校验或商品大于1 + $is_check_goods_site_type = ((isset($params['is_buy']) && $params['is_buy'] == 1) || ($count > 1 && (!isset($params['is_buy']) || $params['is_buy'] == 1))); // 数据校验 foreach($params['goods'] as $v) diff --git a/app/service/OrderService.php b/app/service/OrderService.php index 8f2ecf3d3..302df6305 100755 --- a/app/service/OrderService.php +++ b/app/service/OrderService.php @@ -397,7 +397,7 @@ class OrderService } /** - * 管理员订单支付 + * 线下订单支付 * @author Devil * @blog http://gong.gg/ * @version 1.0.0 @@ -405,7 +405,7 @@ class OrderService * @desc description * @param [array] $params [输入参数] */ - public static function AdminPay($params = []) + public static function OrderPaymentUnderLinePay($params = []) { // 请求参数 $p = [ @@ -414,11 +414,6 @@ class OrderService 'key_name' => 'id', 'error_msg' => '订单id有误', ], - [ - 'checked_type' => 'empty', - 'key_name' => 'admin', - 'error_msg' => '管理员信息有误', - ], ]; $ret = ParamsChecked($params, $p); if($ret !== true) @@ -751,6 +746,10 @@ class OrderService public static function NotifyHandle($data, $payment) { // 支付订单数据 + if(empty($data['out_trade_no'])) + { + return DataReturn('订单号为空[out_trade_no]', -1); + } $pay_data = self::OrderPayLogValueList($data['out_trade_no']); if($pay_data['code'] == 0) {