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)