Просмотр исходного кода

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

- 删除幸福保相关代码调用- 简化总金额计算方式-保留储蓄保金额处理逻辑
- 调整金额字段提取顺序- 移除冗余的金额转换操作
- 更新总金额格式化方法
shichen месяцев назад: 9
Родитель
Сommit
7b66d3e8ec
1 измененных файлов с 1 добавлено и 8 удалено
  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 3389
         try {
3390 3390
             // 储蓄保
3391 3391
             $res = GzcApiRequest::checkAmount($userInfo);
3392
-            // 幸福保
3393
-            $res2 = GzcApiRequest::getAmountXfb($userInfo);
3394 3392
         } catch (\Throwable $e) {
3395 3393
             Log::error('[getAmountFromGzc] 调用异常', ['uid' => $uid, 'error' => $e->getMessage()]);
3396 3394
             return app('json')->fail('查询失败(第三方异常)');
@@ -3399,12 +3397,7 @@ class User extends BaseController
3399 3397
         // 提取 amount(兼容多种字段位置)
3400 3398
         $amountCents = $res['extendData']['amount'] ?? $res['data']['amount'] ?? $res['amount'] ?? null;
3401 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 3402
         // 从 checkAmount 返回的 debug(若存在)
3410 3403
         $debug = $res['debug'] ?? null;