WIN-2308041133\Administrator 3 days ago
parent
commit
f631a8fc57
1 changed files with 7 additions and 2 deletions
  1. 7 2
      app/api/controller/User.php

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

@@ -1396,7 +1396,7 @@ class User extends BaseController
         $post = UtilService::getMore([
         $post = UtilService::getMore([
             ['contract_id','0'],  //合约id
             ['contract_id','0'],  //合约id
             ['content',''],  //评论内容
             ['content',''],  //评论内容
-            ['uid',0]
+//            ['uid',0]
         ],$request);
         ],$request);
         $uid = UtilService::getMore([
         $uid = UtilService::getMore([
             ['uid', 0],
             ['uid', 0],
@@ -1404,13 +1404,18 @@ class User extends BaseController
         $uid=$uid['uid'];
         $uid=$uid['uid'];
 //        $uid = $post['uid'];
 //        $uid = $post['uid'];
         $time=time();
         $time=time();
-        $info = (new UserContractRecordModel)->where("id",$post["contract_id"])->where('start_time','>',$time)->where('end_time','<',$time)->find();
+        $info = (new UserContractRecordModel)->where("id",$post["contract_id"])->find();
         if (!empty($info)){
         if (!empty($info)){
             $info = $info->toArray();
             $info = $info->toArray();
         }
         }
         if ($info['status']!=1){
         if ($info['status']!=1){
             return app('json')->fail("只能在签约期间才能发表评论");
             return app('json')->fail("只能在签约期间才能发表评论");
         }
         }
+        if (strtotime($info['start_time'])<$time||strtotime($info['end_time'])>$time){
+            return app('json')->fail("只能在签约期间才能发表评论");
+
+        }
+//        ->where('start_time','>',$time)->where('end_time','<',$time)
         if(empty($info)){
         if(empty($info)){
             return app('json')->fail("没有签约中的合约");
             return app('json')->fail("没有签约中的合约");
         }
         }