gorden 7 months ago
parent
commit
571d35d21f

+ 14 - 4
app/admin/controller/notify/RechargeController.php

@@ -41,6 +41,14 @@ class RechargeController
 //    }
 
 
+    /**
+     * @Desc
+     * @Author Gorden
+     * @Date 2024/8/19 13:33
+     *
+     * @param Request $request
+     * @return \support\Response
+     */
     public function paySuccess(Request $request)
     {
         $data = $request->post();
@@ -52,8 +60,10 @@ class RechargeController
             return json_fail('参数异常');
         }
         try {
-            _syslog("APP充值","APP充值成功",$data,$data,1001);
-            return $this->disposePaySuccess($data['pay_id']);
+            $result = $this->disposePaySuccess($data['pay_id']);
+            _syslog("APP充值","APP处理完成",$data,$data,1001);
+
+            return $result;
         }catch(BusinessException $e){
             _syslog("APP充值","APP充值失败",$data,$data,1001);
             return json_fail("处理失败");
@@ -82,8 +92,8 @@ class RechargeController
     public function disposePaySuccess($payId){
         $payDetail = PayDetail::find($payId);
         if (!$payDetail || $payDetail->pay_status != 'SUCCESS') {
-            // throw new BusinessException("支付状态异常");
-           return json_fail("支付状态异常");
+             throw new BusinessException("支付状态异常");
+//           return json_fail("支付状态异常");
         }
         $extendJson = [];
         if (!empty($payDetail->pay_extend_json)) {

+ 52 - 52
app/admin/controller/order/WholeController.php

@@ -2056,58 +2056,58 @@ class WholeController extends Curd
             Db::commit();
 
             // 打小票
-            if (!empty($premises) && isset($params['submit_goods_classify']) && $params['submit_goods_classify'] == 'MEALS') {
-                dump("insert 打小票");
-                if ($premises->dept_category != '餐厅') {
-                    $restaurant = SysDept::where('dept_super_id', $premises->dept_id)->where('dept_category', '餐厅')->first();
-                } else {
-                    $restaurant = $premises;
-                }
-
-                if (!empty($restaurant->dept_extend_json)) {
-                    $deptExtendJson = json_decode($restaurant->dept_extend_json, true);
-                    if (isset($deptExtendJson['printer'])) {
-                        foreach ($deptExtendJson['printer'] as $key => $item) {
-                            if (strpos($key, '结算') !== false && $params['order_status_payment'] == 'SUCCESS') {
-                                $voteData = [
-                                    'func' => 'procActionToPrinter',
-                                    'sign' => '',
-                                    'data' => [
-                                        'printer_premises' => $restaurant->dept_id,
-                                        'printer_device' => [
-                                            $key
-                                        ],
-                                        'printer_action' => 'ExecPrintOrder',
-                                        'printer_data' => [
-                                            'order_id' => $params['orderId'],
-                                            'order_batch' => ''
-                                        ]
-                                    ]
-                                ];
-                                http_post_json(getenv('VOTE_MENU_URL'), $voteData);
-                            }
-                            if ((strpos($key, '前台') !== false || strpos($key, '后厨') !== false)) {
-                                $voteData = [
-                                    'func' => 'procActionToPrinter',
-                                    'sign' => '',
-                                    'data' => [
-                                        'printer_premises' => $restaurant->dept_id,
-                                        'printer_device' => [
-                                            $key
-                                        ],
-                                        'printer_action' => 'ExecPrintOrder',
-                                        'printer_data' => [
-                                            'order_id' => $params['orderId'],
-                                            'order_batch' => ''
-                                        ]
-                                    ]
-                                ];
-                                http_post_json(getenv('VOTE_MENU_URL'), $voteData);
-                            }
-                        }
-                    }
-                }
-            }
+//            if (!empty($premises) && isset($params['submit_goods_classify']) && $params['submit_goods_classify'] == 'MEALS') {
+//                dump("insert 打小票");
+//                if ($premises->dept_category != '餐厅') {
+//                    $restaurant = SysDept::where('dept_super_id', $premises->dept_id)->where('dept_category', '餐厅')->first();
+//                } else {
+//                    $restaurant = $premises;
+//                }
+//
+//                if (!empty($restaurant->dept_extend_json)) {
+//                    $deptExtendJson = json_decode($restaurant->dept_extend_json, true);
+//                    if (isset($deptExtendJson['printer'])) {
+//                        foreach ($deptExtendJson['printer'] as $key => $item) {
+//                            if (strpos($key, '结算') !== false && $params['order_status_payment'] == 'SUCCESS') {
+//                                $voteData = [
+//                                    'func' => 'procActionToPrinter',
+//                                    'sign' => '',
+//                                    'data' => [
+//                                        'printer_premises' => $restaurant->dept_id,
+//                                        'printer_device' => [
+//                                            $key
+//                                        ],
+//                                        'printer_action' => 'ExecPrintOrder',
+//                                        'printer_data' => [
+//                                            'order_id' => $params['orderId'],
+//                                            'order_batch' => ''
+//                                        ]
+//                                    ]
+//                                ];
+//                                http_post_json(getenv('VOTE_MENU_URL'), $voteData);
+//                            }
+//                            if ((strpos($key, '前台') !== false || strpos($key, '后厨') !== false)) {
+//                                $voteData = [
+//                                    'func' => 'procActionToPrinter',
+//                                    'sign' => '',
+//                                    'data' => [
+//                                        'printer_premises' => $restaurant->dept_id,
+//                                        'printer_device' => [
+//                                            $key
+//                                        ],
+//                                        'printer_action' => 'ExecPrintOrder',
+//                                        'printer_data' => [
+//                                            'order_id' => $params['orderId'],
+//                                            'order_batch' => ''
+//                                        ]
+//                                    ]
+//                                ];
+//                                http_post_json(getenv('VOTE_MENU_URL'), $voteData);
+//                            }
+//                        }
+//                    }
+//                }
+//            }
 
             dump($params['settlement_now'], $params['order_status_payment']);
             _syslog("订单", "创建订单成功");

+ 1 - 1
app/admin/service/order/OrderService.php

@@ -322,7 +322,7 @@ class OrderService
         if (!empty($result['code']) && $result['code'] == '10000' && !empty($result['trade_status']) && $result['trade_status'] == 'TRADE_SUCCESS') {
             return $result;
         } else {
-            if ($nbr > 5) {
+            if ($nbr > 2) {
                 SupportLog::channel('pay')->error("FIND_ALIPAY", ['msg' => '订单查询失败','order_id'=>$orderId]);
 //                throw new BusinessException("订单查询失败");
                 return ['msg'=>'订单查询失败'];