From f9c6a1bc9abd2cb8af0c3a1c2947aa2bff0af749 Mon Sep 17 00:00:00 2001 From: devil_gong Date: Mon, 26 Nov 2018 15:33:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- alipay/pages/buy/buy.js | 5 +++++ service/Application/Service/BuyService.class.php | 11 +++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/alipay/pages/buy/buy.js b/alipay/pages/buy/buy.js index 6e1541c29..35a8e35a3 100755 --- a/alipay/pages/buy/buy.js +++ b/alipay/pages/buy/buy.js @@ -162,6 +162,11 @@ Page({ } else { my.redirectTo({url: '/pages/user-order/user-order'}); } + } else { + my.showToast({ + type: "fail", + content: res.data.msg + }); } }, fail: () => { diff --git a/service/Application/Service/BuyService.class.php b/service/Application/Service/BuyService.class.php index b89d8a6d3..62baf17f9 100755 --- a/service/Application/Service/BuyService.class.php +++ b/service/Application/Service/BuyService.class.php @@ -545,12 +545,15 @@ class BuyService 'key_name' => 'address_id', 'error_msg' => '地址有误', ], - [ + ]; + if(MyC('common_order_is_booking', 0) != 1) + { + $p[] = [ 'checked_type' => 'empty', 'key_name' => 'payment_id', 'error_msg' => '支付方式有误', - ], - ]; + ]; + } $ret = params_checked($params, $p); if($ret !== true) { @@ -599,7 +602,7 @@ class BuyService 'preferential_price' => $preferential_price, 'price' => $check['data']['total_price'], 'total_price' => $check['data']['total_price']-$preferential_price, - 'payment_id' => intval($params['payment_id']), + 'payment_id' => isset($params['payment_id']) ? intval($params['payment_id']) : 0, 'add_time' => time(), ]; if($order['status'] == 1)