WIN-2308041133\Administrator 2 days ago
parent
commit
fedf3624d7
2 changed files with 18 additions and 1 deletions
  1. 16 1
      app/system/controller/Contract.php
  2. 2 0
      app/system/route/contract.php

+ 16 - 1
app/system/controller/Contract.php

@@ -392,7 +392,22 @@ class Contract extends BaseController
         $article->delete();
         return app('json')->success();
     }
-
+    // 提前中断合同
+    public function endComment(\think\Request $request)
+    {
+        $id = $request->param('id');
+        $post = UtilService::getMore(
+            [
+                ['reason', ''],
+            ], $request
+        );
+        $article = UserContractRecordModel::where('id', $id)->update(['status'=>2,'delete_time'=>time(),'reason'=>$post['reason']]);
+//        if (!$article) {
+//            return app('json')->fail('合同不存在');
+//        }
+//        $article->delete();
+        return app('json')->success();
+    }
 
 
 

+ 2 - 0
app/system/route/contract.php

@@ -20,6 +20,8 @@ Route::group('contract', function () {
     Route::post('getContractInfo', 'contract/getContractInfo');
 //    评论列表
     Route::post('contractCommentList', 'contract/contractCommentList');
+    //   提前中断合同
+    Route::post('endComment', 'contract/endComment');