| 
					
				 | 
			
			
				@@ -246,7 +246,7 @@ class WholeController extends Curd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } else if (!empty($payWay[0]) && $payWay[0] == 'ALIPAY') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $item['payWay'] = '支付宝'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $item['payWay'] = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -460,6 +460,8 @@ class WholeController extends Curd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $order->sheet_amount = number_format($sheetAmount, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $payDetails = PayDetail::where('join_pay_order_id', $order->order_groupby) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ->where('pay_category', '<>', 'REFUND') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ->where('pay_status', 'SUCCESS') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             ->select('pay_id', 'pay_category', 'pay_prepayid', 'pay_paytimes', 'pay_status', 'pay_amount', 'pay_extend_json') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             ->get(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (count($payDetails) > 1) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -957,10 +959,6 @@ class WholeController extends Curd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 去支付 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $result = OrderService::qrcodePay($params); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                // $result = [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                //     'return_code'=>'SUCCESS', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                //     'result_code' => 'SUCCESS' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                // ]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $result = json_encode($result); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $params['pay_json_response'] = $result; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $result = json_decode($result, true); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -968,19 +966,31 @@ class WholeController extends Curd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $prefix = substr($params['qrcode_nbr'], 0, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (in_array($prefix, [10, 11, 12, 13, 14, 15])) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $params['pay_category'] = 'WXPAY'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if ($result['return_code'] != 'SUCCESS' || $result['result_code'] != 'SUCCESS') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        Db::rollBack(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        return json_fail('支付失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if ((!isset($result['return_code']) || $result['return_code'] != 'SUCCESS') || (!isset($result['result_code']) || $result['result_code'] != 'SUCCESS') || (empty($result['trade_state']) || $result['trade_state'] != 'SUCCESS')) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $order->order_status_system = 'PAYING'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $order->order_status_payment = 'PENDING'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $order->order_is_complete = 'N'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//                        Db::rollBack(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//                        return json_fail('支付失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $order->order_status_system = $systemStatus; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $order->order_status_payment = 'SUCCESS'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } else if (in_array($prefix, [25, 26, 27, 28, 29, 30])) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $params['pay_category'] = 'ALIPAY'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if ($result['code'] != '10000' || $result['msg'] != 'Success') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        Db::rollBack(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        return json_fail('支付失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if ((!isset($result['code']) || $result['code'] != '10000') || (empty($result['trade_status']) || $result['trade_status'] != 'TRADE_SUCCESS')) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $order->order_status_system = 'PAYING'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $order->order_status_payment = 'PENDING'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $order->order_is_complete = 'N'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//                        Db::rollBack(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//                        return json_fail('支付失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $order->order_status_system = $systemStatus; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $order->order_status_payment = 'SUCCESS'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     Db::rollBack(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    return json_fail('二维码错误'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    return json_fail('付款码无效'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 组合支付,追加加一条支付记录 pay_detail 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1004,8 +1014,6 @@ class WholeController extends Curd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $params['pay_category'] = $submitPayCategory; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $order->order_status_system = $systemStatus; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $order->order_status_payment = 'SUCCESS'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 账户支付的金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $params['order_amount_pay'] = $accountAmount; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1165,6 +1173,10 @@ class WholeController extends Curd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if ($order->order_status_payment != 'SUCCESS') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                _syslog("订单", "支付异常,检查是否有轮询"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return json_throw(2001, '支付异常', ['order_id' => $params['orderId']]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             _syslog("订单", "订单支付成功"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return json_success('支付成功'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } catch (\Exception $e) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1354,19 +1366,31 @@ class WholeController extends Curd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $prefix = substr($params['qrcode_nbr'], 0, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     if (in_array($prefix, [10, 11, 12, 13, 14, 15])) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         $params['pay_category'] = 'WXPAY'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        if ($result['return_code'] != 'SUCCESS' || $result['result_code'] != 'SUCCESS') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            Db::rollBack(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            return json_fail('支付失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if ((!isset($result['return_code']) || $result['return_code'] != 'SUCCESS') || (!isset($result['result_code']) || $result['result_code'] != 'SUCCESS') || (empty($result['trade_state']) || $result['trade_state'] != 'SUCCESS')) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $order->order_status_system = 'PAYING'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $order->order_status_payment = 'PENDING'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $order->order_is_complete = 'N'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//                        Db::rollBack(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//                        return json_fail('支付失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $order->order_status_system = $systemStatus; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $order->order_status_payment = 'SUCCESS'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } else if (in_array($prefix, [25, 26, 27, 28, 29, 30])) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         $params['pay_category'] = 'ALIPAY'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        if ($result['code'] != '10000' || $result['msg'] != 'Success') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            Db::rollBack(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            return json_fail('支付失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if ((!isset($result['code']) || $result['code'] != '10000') || (empty($result['trade_status']) || $result['trade_status'] != 'TRADE_SUCCESS')) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $order->order_status_system = 'PAYING'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $order->order_status_payment = 'PENDING'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $order->order_is_complete = 'N'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//                        Db::rollBack(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//                        return json_fail('支付失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $order->order_status_system = $systemStatus; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $order->order_status_payment = 'SUCCESS'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         Db::rollBack(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        return json_fail('二维码错误'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        return json_fail('付款码无效'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1374,8 +1398,6 @@ class WholeController extends Curd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 OrderService::createPayConstituteDetail($params, $payDetail); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 账户支付的金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $params['order_amount_pay'] = $orderAmountPay; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $order->order_status_system = $systemStatus; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $order->order_status_payment = 'SUCCESS'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $orderConfigJson = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (!empty($order->order_config_json)) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1453,7 +1475,10 @@ class WholeController extends Curd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if ($order->order_status_payment != 'SUCCESS') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                _syslog("订单", "支付异常,检查是否有轮询"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return json_throw(2001, '支付异常', ['order_id' => $params['orderId']]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             _syslog("订单", "订单支付成功"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return json_success('支付成功'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } catch (\Exception $e) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1861,20 +1886,35 @@ class WholeController extends Curd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $prefix = substr($params['qrcode_nbr'], 0, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     if (in_array($prefix, [10, 11, 12, 13, 14, 15])) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         $params['pay_category'] = 'WXPAY'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        if ($result['return_code'] != 'SUCCESS' || $result['result_code'] != 'SUCCESS') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            Db::rollBack(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            return json_fail('支付失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if ((!isset($result['return_code']) || $result['return_code'] != 'SUCCESS') || (!isset($result['result_code']) || $result['result_code'] != 'SUCCESS') || (empty($result['trade_state']) || $result['trade_state'] != 'SUCCESS')) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $params['order_status_system'] = 'PAYING'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $params['order_status_payment'] = 'PENDING'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $params['order_is_complete'] = 'N'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//                            Db::rollBack(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//                            return json_fail('支付失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $params['order_status_system'] = $systemStatus; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $params['order_status_payment'] = 'SUCCESS'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } else if (in_array($prefix, [25, 26, 27, 28, 29, 30])) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         $params['pay_category'] = 'ALIPAY'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        if ($result['code'] != '10000' || $result['msg'] != 'Success') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            Db::rollBack(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            return json_fail('支付失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if ((!isset($result['code']) || $result['code'] != '10000') || (empty($result['trade_status']) || $result['trade_status'] != 'TRADE_SUCCESS')) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $params['order_status_system'] = 'PAYING'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $params['order_status_payment'] = 'PENDING'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $params['order_is_complete'] = 'N'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//                            Db::rollBack(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//                            return json_fail('支付失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $params['order_status_system'] = $systemStatus; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $params['order_status_payment'] = 'SUCCESS'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Db::rollBack(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        return json_fail('付款码无效'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     // 组合支付,追加加一条支付记录 pay_detail 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if ($params['pay_constitute'] == 'Y' && $qrcodePayAmount > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if ($params['pay_constitute'] == 'Y' && $qrcodePayAmount > 0 && $params['order_status_payment'] == 'SUCCESS') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         $insertPayDetailData = [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             'join_pay_member_id' => $params['join_order_member_id'], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             'join_pay_order_id' => $params['orderGroupId'], 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1894,8 +1934,6 @@ class WholeController extends Curd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         $params['pay_category'] = $submitPayCategory; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    $params['order_status_system'] = $systemStatus; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    $params['order_status_payment'] = 'SUCCESS'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     // 账户支付的金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $params['order_amount_pay'] = $accountAmount; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1926,10 +1964,13 @@ class WholeController extends Curd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $params['submit_premises_id'] = $premises->dept_id; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (isset($params['submit_goods_classify']) && $params['submit_goods_classify'] == 'MEALS' && !empty($params['dept_table_id'])) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $table = SysDept::where('dept_id', $params['dept_table_id'])->where('dept_category', '桌台')->first(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (isset($params['submit_goods_classify']) && $params['submit_goods_classify'] == 'MEALS' && !empty($params['dept_premises_id'])) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $table = ''; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (!empty($params['dept_table_id'])){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $table = SysDept::where('dept_id', $params['dept_table_id'])->where('dept_category', '桌台')->first(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $orderConfigJson['premises'] = $params['dept_premises_id']; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $orderConfigJson['dept'] = $premises->dept_id; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $orderConfigJson['dept'] = $premises->dept_id ?? 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $orderConfigJson['reach'] = "00:00"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $orderConfigJson['table'] = !empty($table) ? $table->dept_name : null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $orderConfigJson['express'] = "到店吃"; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -2100,6 +2141,10 @@ class WholeController extends Curd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if ($params['settlement_now'] == 'Y' && $params['order_status_payment'] != 'SUCCESS') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                _syslog("订单", "支付异常,检查是否有轮询"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return json_throw(2001, '支付异常', ['order_id' => $params['orderId']]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             _syslog("订单", "创建订单成功"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return json_success('创建订单成功'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } catch (BusinessException $e) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -2247,12 +2292,13 @@ class WholeController extends Curd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $account->member_account_expend = $account->member_account_expend + $params['order_amount_pay']; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $account->save(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $params['order_status_system'] = $systemStatus; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $params['order_status_payment'] = 'SUCCESS'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 生成支付记录 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 OrderService::createPayDetail($params); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $params['order_amount_pay'] = $orderAmountPay; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $params['order_status_system'] = $systemStatus; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $params['order_status_payment'] = 'SUCCESS'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             // if ($params['settlement_now'] == 'Y' && $params['pay_category'] == 'WELFARE') {  // 福利账户 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //     $account = MemberAccount::where('join_account_member_id', $params['join_order_member_id']) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -2322,12 +2368,13 @@ class WholeController extends Curd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $account->member_account_expend = $account->member_account_expend + $params['order_amount_pay']; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $account->save(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $params['order_status_system'] = $systemStatus; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $params['order_status_payment'] = 'SUCCESS'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 生成支付记录 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 OrderService::createPayDetail($params); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $params['order_amount_pay'] = $orderAmountPay; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $params['order_status_system'] = $systemStatus; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $params['order_status_payment'] = 'SUCCESS'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //!empty($params['pay_category_constitute']) && in_array('CARD',$params['pay_category_constitute']) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             // if(($params['pay_constitute'] == 'Y' || $params['pay_category'] == 'QRCODE') && $params['settlement_now'] == 'Y' && !empty($params['qrcode_nbr'])){     // 付款码 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -2345,15 +2392,27 @@ class WholeController extends Curd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $prefix = substr($params['qrcode_nbr'], 0, 2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     if (in_array($prefix, [10, 11, 12, 13, 14, 15])) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         $params['pay_category'] = 'WXPAY'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        if ($result['return_code'] != 'SUCCESS' || $result['result_code'] != 'SUCCESS') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            Db::rollBack(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            return json_fail('支付失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if ((!isset($result['return_code']) || $result['return_code'] != 'SUCCESS') || (!isset($result['result_code']) || $result['result_code'] != 'SUCCESS') || (empty($result['trade_state']) || $result['trade_state'] != 'SUCCESS')) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $params['order_status_system'] = 'PAYING'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $params['order_status_payment'] = 'PENDING'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $params['order_is_complete'] = 'N'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//                            Db::rollBack(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//                            return json_fail('支付失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $params['order_status_system'] = $systemStatus; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $params['order_status_payment'] = 'SUCCESS'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } else if (in_array($prefix, [25, 26, 27, 28, 29, 30])) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         $params['pay_category'] = 'ALIPAY'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        if ($result['code'] != '10000' || $result['msg'] != 'Success') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            Db::rollBack(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            return json_fail('支付失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if ((!isset($result['code']) || $result['code'] != '10000') || (empty($result['trade_status']) || $result['trade_status'] != 'TRADE_SUCCESS')) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $params['order_status_system'] = 'PAYING'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $params['order_status_payment'] = 'PENDING'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $params['order_is_complete'] = 'N'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//                            Db::rollBack(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//                            return json_fail('支付失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $params['order_status_system'] = $systemStatus; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            $params['order_status_payment'] = 'SUCCESS'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         Db::rollBack(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -2365,8 +2424,6 @@ class WholeController extends Curd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     // 账户支付的金额 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $params['order_amount_pay'] = $orderAmountPay; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $params['order_status_system'] = $systemStatus; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $params['order_status_payment'] = 'SUCCESS'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $orderConfigJson = []; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -2508,7 +2565,6 @@ class WholeController extends Curd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             // 打小票 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (!empty($premises) && isset($params['submit_goods_classify']) && $params['submit_goods_classify'] == 'MEALS') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                dump("insertCons 打小票"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //            if (!empty($premises)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if ($premises->dept_category != '餐厅') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $restaurant = SysDept::where('dept_super_id', $premises->dept_id)->where('dept_category', '餐厅')->first(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -2560,6 +2616,10 @@ class WholeController extends Curd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if ($params['settlement_now'] == 'Y' && $params['order_status_payment'] != 'SUCCESS') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                _syslog("订单", "支付异常,检查是否有轮询"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return json_throw(2001, '支付异常', ['order_id' => $params['orderId']]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             _syslog("订单", "创建订单成功"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return json_success('创建订单成功'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } catch (BusinessException $e) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -2662,7 +2722,7 @@ class WholeController extends Curd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     'join_sheet_order_id' => $params['orderId'], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     'join_sheet_goods_id' => $goods['goods_id'], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     'join_sheet_goods_sku_id' => $goods['sku_id'], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    'order_sheet_status' => $params['settlement_now'] == 'Y' ? 'DONE' : 'PAYING', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    'order_sheet_status' => $params['settlement_now'] == 'Y' && $params['order_status_payment'] == 'SUCCESS' ? 'DONE' : 'PAYING', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     'order_sheet_category' => (isset($params['submit_goods_classify']) && $params['submit_goods_classify'] == 'MEALS') ? 'DISHES' : 'NORMAL', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     'order_sheet_num' => $goods['nbr'], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     'order_sheet_price' => $goods['goods_sales_price'], 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -2733,7 +2793,7 @@ class WholeController extends Curd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $data = [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 'join_pay_member_id' => $params['join_order_member_id'], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 'join_pay_order_id' => $params['orderGroupId'], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                'pay_status' => $params['settlement_now'] == 'Y' ? 'SUCCESS' : 'WAITING', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                'pay_status' => $params['settlement_now'] == 'Y' && $params['order_status_payment'] == 'SUCCESS' ? 'SUCCESS' : 'WAITING', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 'pay_category' => $params['goods_classify'], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 'pay_amount' => $params['order_amount_pay'], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 'pay_prepayid' => $payPrepayid, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -3488,7 +3548,6 @@ class WholeController extends Curd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public function doRefund(Request $request) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $orderId = $request->post('order_id', ''); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // $returnId = $request->post('return_id', ''); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $amount = $request->post('refund_amount', 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $password = $request->post('refund_password', ''); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (!$orderId || !$amount || !$password) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -3913,6 +3972,82 @@ class WholeController extends Curd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return $data; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @Desc 查询订单状态 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @Author Gorden 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @Date 2024/8/19 11:55 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param Request $request 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @return Response|void 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public function getOrderPayStatus(Request $request) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $orderId = $request->get('order_id', ''); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (!$orderId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return json_fail('订单不存在'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $order = Order::where('order_id', $orderId)->first(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (!$order) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return json_fail('订单不存在'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if ($order->order_status_payment == 'SUCCESS') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return json_success('success'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $payDetailType = PayDetail::where('join_pay_order_id', $order->order_groupby)->pluck('pay_prepayid')->toArray(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Db::beginTransaction(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (in_array('WXPAY', $payDetailType)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $result = Pay::wechat(config('payment.wxpay'))->find($order->order_groupby, 'pos'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $result = json_decode(json_encode($result), true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (!empty($result['return_code']) && $result['return_code'] == 'SUCCESS' && !empty($result['result_code']) && $result['result_code'] == 'SUCCESS' && !empty($result['trade_state']) && $result['trade_state'] == 'SUCCESS') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (in_array($order->order_category, ['SERVICE', 'CHNMED', 'CHNNCD', 'DISHES', 'MEALS', 'VIP'])) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $order->order_is_complete = 'Y'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $order->order_status_system = 'DONE'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $order->order_status_payment = 'SUCCESS'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $order->order_status_system = 'SENDING'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $order->save(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    // Sheet 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    OrderSheet::where('join_sheet_order_id', $orderId)->where('order_sheet_status', 'PAYING')->update(['order_sheet_status' => 'DONE']); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    // 支付记录 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    PayDetail::where('join_pay_order_id', $order->order_groupby)->where('pay_prepayid', 'WXPAY')->update(['pay_status' => 'SUCCESS']); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Db::commit(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    return json_success('success'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } else if (in_array('ALIPAY', $payDetailType)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $result = Pay::alipay(config('payment.alipay'))->find($order->order_groupby); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $result = json_decode(json_encode($result), true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (!empty($result['code']) && $result['code'] == '10000' && !empty($result['trade_status']) && $result['trade_status'] == 'TRADE_SUCCESS') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (in_array($order->order_category, ['SERVICE', 'CHNMED', 'CHNNCD', 'DISHES', 'MEALS', 'VIP'])) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $order->order_is_complete = 'Y'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $order->order_status_system = 'DONE'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $order->order_status_payment = 'SUCCESS'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $order->order_status_system = 'SENDING'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $order->save(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    // Sheet 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    OrderSheet::where('join_sheet_order_id', $orderId)->where('order_sheet_status', 'PAYING')->update(['order_sheet_status' => 'DONE']); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    // 支付记录 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    PayDetail::where('join_pay_order_id', $order->order_groupby)->where('pay_prepayid', 'ALIPAY')->update(['pay_status' => 'SUCCESS']); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Db::commit(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    return json_success('success'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Db::rollBack(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return json_fail('没有查询到记录'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } catch (\Exception $e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Db::rollBack(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return json_fail('查询失败'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public static $goodsClassify = [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // goodsClassify: {GOODS:"健康产品订单",SERVICE:"服务订单",DEVICE:"设备订单",SPECIAL:"专题业务订单",PACKAGE:"套餐订单",RECHARGE:"充值订单",OTHER:"其他订单"}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 |