소스 검색

增加查看协议方法

sunxbiao 8 달 전
부모
커밋
cd4147c555
3개의 변경된 파일11개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 0
      app/common/repositories/agreement/AgreementRepository.php
  2. 4 1
      app/controller/admin/agreement/Agreement.php
  3. 2 0
      route/admin.php

+ 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")

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

@@ -42,5 +42,8 @@ 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
+        return $this->repository->getDetailContent($id);
48
+    }
46
 }
49
 }

+ 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;