gorden hace 6 meses
padre
commit
df664b2eee

+ 9 - 6
app/admin/controller/order/WholeController.php

@@ -2263,12 +2263,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'])
@@ -2338,12 +2339,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'])){     // 付款码
@@ -2370,7 +2372,6 @@ class WholeController extends Curd
                         } else {
                             $params['order_status_system'] = $systemStatus;
                             $params['order_status_payment'] = 'SUCCESS';
-                            $params['order_is_complete'] = 'N';
                         }
                     } else if (in_array($prefix, [25, 26, 27, 28, 29, 30])) {
                         $params['pay_category'] = 'ALIPAY';
@@ -4013,8 +4014,10 @@ class WholeController extends Curd
                 }
             }
             Db::rollBack();
+            return json_fail('查询失败');
         } catch (\Exception $e) {
             Db::rollBack();
+            return json_fail('查询失败');
         }
     }
 

+ 2 - 4
app/admin/service/order/OrderService.php

@@ -233,7 +233,6 @@ class OrderService
 //                throw new BusinessException("支付失败");
             }
             try{
-                dump($result);
                 $log->info("WXPAY_RETURN", json_decode(json_encode($result), true));
             }catch (\Exception $e){}
 
@@ -261,7 +260,7 @@ class OrderService
                 $log->info("ALIPAY_RETURN", json_decode(json_encode($result), true));
             }catch (\Exception $e){}
         } else {
-            throw new BusinessException("二维码无效");
+            throw new BusinessException("付款码无效");
         }
 
         return $result;
@@ -324,7 +323,6 @@ class OrderService
         } else {
             if ($nbr > 2) {
                 SupportLog::channel('pay')->error("FIND_ALIPAY", ['msg' => '订单查询失败','order_id'=>$orderId]);
-//                throw new BusinessException("订单查询失败");
                 return ['msg'=>'订单查询失败'];
             }
             sleep(5);
@@ -366,7 +364,7 @@ class OrderService
         $insertPayDetailData = [
             'join_pay_member_id' => $params['join_order_member_id'],
             'join_pay_order_id' => $params['orderGroupId'],
-            'pay_status' => 'SUCCESS',
+            'pay_status' => $params['order_status_payment'] == 'SUCCESS' ? 'SUCCESS' : 'WAITING',
             'pay_category' => !empty($params['submit_goods_classify']) ? $params['submit_goods_classify'] : $params['goods_classify'],
             'pay_amount' => $params['order_amount_pay'],
             'pay_paytimes' => date('Y-m-d H:i:s'),