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

Merge remote-tracking branch 'origin/dev' into dev

Xpy месяцев назад: 8
Родитель
Сommit
671eb05e4d

+ 5 - 0
app/common/repositories/agreement/AgreementRepository.php

@@ -23,6 +23,11 @@ class AgreementRepository extends BaseRepository
23
         return Db::name("user_agreement")->where(['agreement_id'=>$id])->find();
23
         return Db::name("user_agreement")->where(['agreement_id'=>$id])->find();
24
     }
24
     }
25
 
25
 
26
+    /*详情*/
27
+    public function getDetailContent($id){
28
+        return Db::name("user_agreement")->where(['agreement_id' => $id])->find()['content'] ?? '';
29
+    }
30
+
26
     /*修改*/
31
     /*修改*/
27
     public function updateData($id,$data){
32
     public function updateData($id,$data){
28
         return Db::name("user_agreement")
33
         return Db::name("user_agreement")

+ 7 - 1
app/controller/admin/agreement/Agreement.php

@@ -42,5 +42,11 @@ class Agreement extends BaseController
42
         return app("json")->success($this->repository->updateData($id,$data));
42
         return app("json")->success($this->repository->updateData($id,$data));
43
     }
43
     }
44
 
44
 
45
-
45
+    /*详情*/
46
+    public function  detailContent($id){
47
+        if ($id != 13) {
48
+            return '';
49
+        }
50
+        return $this->repository->getDetailContent($id);
51
+    }
46
 }
52
 }

+ 2 - 2
app/controller/api/store/merchant/Taskorderguquan.php

@@ -40,7 +40,7 @@ class Taskorderguquan
40
          * 13231658486周军市场补贴400
40
          * 13231658486周军市场补贴400
41
          * 13331043787张吉良65
41
          * 13331043787张吉良65
42
          * 15332507711 张传莲 50
42
          * 15332507711 张传莲 50
43
-         * 18715313601大饼200
43
+         * 18715313601大饼100
44
          */
44
          */
45
         $data = [
45
         $data = [
46
             '13231658486' => 700,
46
             '13231658486' => 700,
@@ -63,7 +63,7 @@ class Taskorderguquan
63
             '13381085923' => 50,
63
             '13381085923' => 50,
64
             '13331043787' => 65,
64
             '13331043787' => 65,
65
             '15332507711' => 50,
65
             '15332507711' => 50,
66
-            '18715313601' => 200
66
+            '18715313601' => 100
67
         ];
67
         ];
68
 
68
 
69
         $result = Db::name("user")
69
         $result = Db::name("user")

+ 13 - 10
app/traits/GzcApiRequest.php

@@ -56,7 +56,11 @@ trait GzcApiRequest
56
      */
56
      */
57
     public static function checkAmount($user)
57
     public static function checkAmount($user)
58
     {
58
     {
59
-        $cardType = $user['card_type'] ? $user['card_type'] : 10;
59
+        Log::info('用户实名信息:' . json_encode($user));
60
+        $cardType = $user['card_type'];
61
+        if ($user['card_type'] == 2) {
62
+            $cardType = '10';
63
+        }
60
         $cxbData = [
64
         $cxbData = [
61
             'platformNo' => env('GZC.PLATFORM_NO'),
65
             'platformNo' => env('GZC.PLATFORM_NO'),
62
             'appNo' => env('GZC.APP_NO'),
66
             'appNo' => env('GZC.APP_NO'),
@@ -87,8 +91,6 @@ trait GzcApiRequest
87
 
91
 
88
         $amount = $cxbResponseData['extendData']['amount'] + $xfbResponseData['extendData']['amount'];
92
         $amount = $cxbResponseData['extendData']['amount'] + $xfbResponseData['extendData']['amount'];
89
         return $amount;
93
         return $amount;
90
-
91
-
92
     }
94
     }
93
     public function getAmountFromGzc()
95
     public function getAmountFromGzc()
94
     {
96
     {
@@ -107,17 +109,18 @@ trait GzcApiRequest
107
             return app('json')->fail('查询失败(第三方异常)');
109
             return app('json')->fail('查询失败(第三方异常)');
108
         }
110
         }
109
 
111
 
110
-        if (!is_array($res) || ($res['code'] ?? -1) !== 0) {
111
-            return app('json')->fail($res['message'] ?? '查询失败');
112
-        }
113
-
114
-        $amountCents = $res['extendData']['amount'] ?? $res['data']['amount'] ?? $res['amount'] ?? 0;
115
-        $amount = floatval($amountCents) * 0.01;
112
+        // 提取 amount(兼容多种字段位置)
113
+        $amountCents = $res['extendData']['amount'] ?? $res['data']['amount'] ?? $res['amount'] ?? null;
114
+        $amount = $amountCents === null ? 0.0 : floatval($amountCents) * 0.01;
116
         $formatted = sprintf('%.2f', $amount);
115
         $formatted = sprintf('%.2f', $amount);
117
 
116
 
117
+        // 从 checkAmount 返回的 debug(若存在)
118
+        $debug = $res['debug'] ?? null;
119
+
120
+        // 返回 amount 与 debug 给调用方(前端 / 调试)
118
         return app('json')->success([
121
         return app('json')->success([
119
             'amount' => $formatted,
122
             'amount' => $formatted,
120
-            'debug'  => $res['debug'] ?? null,
123
+            'debug'  => $debug
121
         ]);
124
         ]);
122
     }
125
     }
123
     /**
126
     /**

+ 2 - 0
route/admin.php

@@ -2,6 +2,8 @@
2
 
2
 
3
 use think\facade\Route;
3
 use think\facade\Route;
4
 
4
 
5
+Route::get('agreement/detailContent/:id', 'admin.agreement.Agreement/detailContent');
6
+
5
 Route::group(config('admin.admin_prefix'), function () {
7
 Route::group(config('admin.admin_prefix'), function () {
6
     Route::miss(function () {
8
     Route::miss(function () {
7
         $DB = DIRECTORY_SEPARATOR;
9
         $DB = DIRECTORY_SEPARATOR;