Sfoglia il codice sorgente

发布内容限制

wzq 5 anni fa
parent
commit
be08598312
1 ha cambiato i file con 5 aggiunte e 5 eliminazioni
  1. 5 5
      app/Repositories/PostRepositories.php

+ 5 - 5
app/Repositories/PostRepositories.php

@@ -81,11 +81,11 @@ class PostRepositories
         if($userInfo['strength']){
             $isValid = 1;
         }
-//        $oneHourTime = Carbon::now()->addHours(-1)->toDateTimeString();
-//        $oneHourPostCount = $this->post->where('uid', $userInfo['uid'])->where('created_at', '>', $oneHourTime)->count();
-//        if($oneHourPostCount > 5){
-//            return jsonError('创作欲望太强啦,休息一下,看看其他用户的内容吧!');
-//        }
+        $oneHourTime = Carbon::now()->addHours(-1)->toDateTimeString();
+        $oneHourPostCount = $this->post->where('uid', $userInfo['uid'])->where('created_at', '>', $oneHourTime)->count();
+        if($oneHourPostCount > 5){
+            return jsonError('创作欲望太强啦,休息一下,看看其他用户的内容吧!');
+        }
 
         $detectionText = $request['title'] .','. $request['content'];
         $detectionTextResult = $this->detectionService->checkText($detectionText);