WIN-2308041133\Administrator 3 days ago
parent
commit
0dbe1d5781
2 changed files with 29 additions and 9 deletions
  1. 2 2
      app/api/controller/User.php
  2. 27 7
      app/system/controller/Contract.php

+ 2 - 2
app/api/controller/User.php

@@ -1376,8 +1376,8 @@ class User extends BaseController
             ['content',''],  //评论内容
             ['uid',0]
         ],$request);
-//        $uid = $request->user["uid"];
-        $uid = $post['uid'];
+        $uid = $request->user["uid"];
+//        $uid = $post['uid'];
         $time=time();
         $info = (new UserContractRecordModel)->where("id",$post["contract_id"])->where('start_time','>',$time)->where('end_time','<',$time)->find();
         if (!empty($info)){

+ 27 - 7
app/system/controller/Contract.php

@@ -42,14 +42,25 @@ class Contract extends BaseController
         $post = UtilService::getMore(
             [
                 ['page', 1],
-                ['phone',''],  //甲方uid或者电话
-                ['to_phone',''], //乙方uid或者电话
-                ['contract_no', ''],
-                ['status',''],
+                ['uid',''],  //甲方uid
+                ['name',''],  //甲方姓名
+                ['phone',''],  //甲方电话
+                ['to_uid',''], //乙方uid
+                ['to_name',''], //乙方姓名
+                ['to_phone',''], //乙方电话
+                ['contract_id', ''], //订单id
+                ['contract_no', ''], //订单编号
+                ['status',''],//状态 0未确认 1已签约 2已到期 -1取消签约
                 ['time',[]],
             ], $request
         );
         $where = [];
+        if(!empty($post['uid'])){
+            $where[]=["uid","=",$post['uid']];
+        }
+        if(!empty($post['name'])){
+            $where[]=["name","like","%{$post["name"]}%"];
+        }
         if(!empty($post['phone'])){
             $where[]=["phone","=",$post['phone']];
         }
@@ -60,11 +71,20 @@ class Contract extends BaseController
 //                $where[]=["o.uid","=",$m['uid']];
 //            }
 //        }
+        if(!empty($post['to_uid'])){
+            $where[]=["to_uid","=",$post['to_uid']];
+        }
+        if(!empty($post['to_name'])){
+            $where[]=["to_name","like","%{$post["to_name"]}%"];
+        }
         if(!empty($post['to_phone'])){
             $where[]=["to_phone","=",$post['to_phone']];
         }
         if(!empty($post['contract_no'])){
-            $where[]=["contract_no","=",$post['contract_no']];
+            $where[]=["contract_no","like","%{$post["contract_no"]}%"];
+        }
+        if(!empty($post['contract_id'])){
+            $where[]=["contract_id","=",$post['contract_id']];
         }
         if(!empty($post['status'])){
             $where[]=["status","=",$post['status']];
@@ -219,7 +239,7 @@ class Contract extends BaseController
 //            }
 //        }
         if(!empty($post['nickname'])){
-            $where[]=["nickname","like",$post['nickname']];
+            $where[]=["nickname","like","%{$post["name"]}%"];
         }
         if(!empty($post['contract_id'])){
             $where[]=["contract_id","=",$post['contract_id']];
@@ -296,7 +316,7 @@ class Contract extends BaseController
 //            }
 //        }
         if(!empty($post['nickname'])){
-            $where[]=["nickname","like",$post['nickname']];
+            $where[]=["nickname","like","%{$post["name"]}%"];
         }
         if(!empty($post['contract_id'])){
             $where[]=["contract_id","=",$post['contract_id']];