Explorar o código

获取规则文章

xialei hai 1 ano
pai
achega
9d68aa6c6d
Modificáronse 2 ficheiros con 42 adicións e 0 borrados
  1. 40 0
      app/controller/api/user/User.php
  2. 2 0
      route/api.php

+ 40 - 0
app/controller/api/user/User.php

@@ -2065,6 +2065,46 @@ class User extends BaseController
2065 2065
         return app("json")->success($data);
2066 2066
     }
2067 2067
 
2068
+
2069
+    /*获取规则文章*/
2070
+    public function guize()
2071
+    {
2072
+        $id = $this->request->param('id');
2073
+        $data = app()->make(\app\common\repositories\agreement\AgreementRepository::class)->getTypeDetail($id);
2074
+        if(!$data){
2075
+            $data['title']='';
2076
+            $data['content']='';
2077
+        }
2078
+
2079
+        $html='<!DOCTYPE html>
2080
+        <html lang="en">
2081
+        <head>
2082
+            <meta charset="UTF-8">
2083
+            <meta name="viewport" content="width=device-width, initial-scale=1.0">
2084
+            <title>'.$data['title'].'</title>
2085
+            <style>
2086
+            body {
2087
+            font-family: Arial, sans-serif;
2088
+            margin: 0;
2089
+            padding: 0;
2090
+            }
2091
+
2092
+            .container {
2093
+            margin: 0 auto;
2094
+            padding: 20px;
2095
+            }
2096
+        </style>
2097
+        </head>
2098
+        <body>
2099
+        <div class="container">
2100
+        '.$data['content'].'
2101
+        </div>
2102
+        </body>
2103
+        </html';
2104
+        return $html;
2105
+    }
2106
+
2107
+
2068 2108
     /**
2069 2109
      * 支付宝获取授权
2070 2110
      * @return mixed

+ 2 - 0
route/api.php

@@ -1056,6 +1056,8 @@ Route::group('api/', function () {
1056 1056
 
1057 1057
     /*协议*/
1058 1058
     Route::get('xieyi/detail', 'api.user.User/xieyi');
1059
+    /*协议*/
1060
+    Route::get('guize/detail', 'api.user.User/guize');
1059 1061
 
1060 1062
 
1061 1063
     /*营业执照识别*/