Explorar el Código

feat(user): 移除幸福保金额计算逻辑

- 删除幸福保相关代码调用- 简化总金额计算方式-保留储蓄保金额处理逻辑
- 调整金额字段提取顺序- 移除冗余的金额转换操作
- 更新总金额格式化方法
shichen hace 9 meses
padre
commit
7b66d3e8ec
Se han modificado 1 ficheros con 1 adiciones y 8 borrados
  1. 1 8
      app/controller/api/user/User.php

+ 1 - 8
app/controller/api/user/User.php

@@ -3389,8 +3389,6 @@ class User extends BaseController
3389
         try {
3389
         try {
3390
             // 储蓄保
3390
             // 储蓄保
3391
             $res = GzcApiRequest::checkAmount($userInfo);
3391
             $res = GzcApiRequest::checkAmount($userInfo);
3392
-            // 幸福保
3393
-            $res2 = GzcApiRequest::getAmountXfb($userInfo);
3394
         } catch (\Throwable $e) {
3392
         } catch (\Throwable $e) {
3395
             Log::error('[getAmountFromGzc] 调用异常', ['uid' => $uid, 'error' => $e->getMessage()]);
3393
             Log::error('[getAmountFromGzc] 调用异常', ['uid' => $uid, 'error' => $e->getMessage()]);
3396
             return app('json')->fail('查询失败(第三方异常)');
3394
             return app('json')->fail('查询失败(第三方异常)');
@@ -3399,12 +3397,7 @@ class User extends BaseController
3399
         // 提取 amount(兼容多种字段位置)
3397
         // 提取 amount(兼容多种字段位置)
3400
         $amountCents = $res['extendData']['amount'] ?? $res['data']['amount'] ?? $res['amount'] ?? null;
3398
         $amountCents = $res['extendData']['amount'] ?? $res['data']['amount'] ?? $res['amount'] ?? null;
3401
         $amount = $amountCents === null ? 0.0 : floatval($amountCents) * 0.01;
3399
         $amount = $amountCents === null ? 0.0 : floatval($amountCents) * 0.01;
3402
-
3403
-        // 幸福保
3404
-        $amountCents2 = $res2['extendData']['amount'] ?? $res2['data']['amount'] ?? $res2['amount'] ?? null;
3405
-        $amount2 = $amountCents === null ? 0.0 : floatval($amountCents2) * 0.01;
3406
-
3407
-        $formatted = sprintf('%.2f', $amount + $amount2);
3400
+        $formatted = sprintf('%.2f', $amount);
3408
 
3401
 
3409
         // 从 checkAmount 返回的 debug(若存在)
3402
         // 从 checkAmount 返回的 debug(若存在)
3410
         $debug = $res['debug'] ?? null;
3403
         $debug = $res['debug'] ?? null;