Przeglądaj źródła

公证处检测问题

Xpy 8 miesięcy temu
rodzic
commit
f9d2b84e96
2 zmienionych plików z 11 dodań i 13 usunięć
  1. 4 5
      app/controller/api/user/User.php
  2. 7 8
      app/traits/GzcApiRequest.php

+ 4 - 5
app/controller/api/user/User.php

@@ -3376,11 +3376,10 @@ class User extends BaseController
3376
         $uid = $this->request->uid();
3376
         $uid = $this->request->uid();
3377
         $userInfo = Db::name('UserCertification')->where('uid', $uid)->field('user_name,user_card,card_type')->find();
3377
         $userInfo = Db::name('UserCertification')->where('uid', $uid)->field('user_name,user_card,card_type')->find();
3378
         $res = GzcApiRequest::checkAmount($userInfo);
3378
         $res = GzcApiRequest::checkAmount($userInfo);
3379
-//        if(is_string($res)) {
3380
-//            return app('json')->fail($res);
3381
-//        }
3382
-//        return app('json')->success(['amount' => sprintf("%01.2f", $res * 0.01)]);
3383
-        return app('json')->success($res);
3379
+        if(is_string($res)) {
3380
+            return app('json')->fail($res);
3381
+        }
3382
+        return app('json')->success(['amount' => sprintf("%01.2f", $res * 0.01)]);
3384
     }
3383
     }
3385
 
3384
 
3386
     public function check_user_annual_fee()
3385
     public function check_user_annual_fee()

+ 7 - 8
app/traits/GzcApiRequest.php

@@ -67,9 +67,9 @@ trait GzcApiRequest
67
         Log::info('储蓄保养老金请求参数:' . json_encode($cxbData));
67
         Log::info('储蓄保养老金请求参数:' . json_encode($cxbData));
68
         $cxbResponseData = self::request('POST', '/v1/api/third/in/in30', $cxbData, [], 1);
68
         $cxbResponseData = self::request('POST', '/v1/api/third/in/in30', $cxbData, [], 1);
69
         Log::info('储蓄保养老金请求返回:' . json_encode($cxbResponseData));
69
         Log::info('储蓄保养老金请求返回:' . json_encode($cxbResponseData));
70
-//        if($cxbResponseData['code'] != 0) {
71
-//            return $cxbResponseData['message'];
72
-//        }
70
+        if($cxbResponseData['code'] != 0) {
71
+            return $cxbResponseData['message'];
72
+        }
73
 
73
 
74
         $xfbData = [
74
         $xfbData = [
75
             'platformNo' => env('XINGFUBAO.PLATFORM_NO'),
75
             'platformNo' => env('XINGFUBAO.PLATFORM_NO'),
@@ -81,13 +81,12 @@ trait GzcApiRequest
81
         Log::info('幸福保养老金请求参数:' . json_encode($xfbData));
81
         Log::info('幸福保养老金请求参数:' . json_encode($xfbData));
82
         $xfbResponseData = self::request('POST', '/v1/api/third/in/in30', $xfbData, [], 2);
82
         $xfbResponseData = self::request('POST', '/v1/api/third/in/in30', $xfbData, [], 2);
83
         Log::info('幸福保养老金请求返回:' . json_encode($xfbResponseData));
83
         Log::info('幸福保养老金请求返回:' . json_encode($xfbResponseData));
84
-//        if($xfbResponseData['code'] != 0) {
85
-//            return $xfbResponseData['message'];
86
-//        }
84
+        if($xfbResponseData['code'] != 0) {
85
+            return $xfbResponseData['message'];
86
+        }
87
 
87
 
88
         $amount = $cxbResponseData['extendData']['amount'] + $xfbResponseData['extendData']['amount'];
88
         $amount = $cxbResponseData['extendData']['amount'] + $xfbResponseData['extendData']['amount'];
89
-        //return $amount;
90
-        return $xfbResponseData;
89
+        return $amount;
91
 
90
 
92
 
91
 
93
     }
92
     }