Bläddra i källkod

发布内容是否有效触发

wzq 5 år sedan
förälder
incheckning
ef23ff6a5d
1 ändrade filer med 5 tillägg och 0 borttagningar
  1. 5 0
      app/Repositories/PostRepositories.php

+ 5 - 0
app/Repositories/PostRepositories.php

@@ -59,6 +59,10 @@ class PostRepositories
             Log::info('获取用户信息失败');
             Log::info('获取用户信息失败');
             return jsonError('获取用户信息失败');
             return jsonError('获取用户信息失败');
         }
         }
+        $isValid = 0;
+        if($userInfo['strength']){
+            $isValid = 1;
+        }
         $oneHourTime = Carbon::now()->addHours(-1)->toDateTimeString();
         $oneHourTime = Carbon::now()->addHours(-1)->toDateTimeString();
         $oneHourPostCount = $this->post->where('uid', $userInfo['uid'])->where('created_at', '>', $oneHourTime)->count();
         $oneHourPostCount = $this->post->where('uid', $userInfo['uid'])->where('created_at', '>', $oneHourTime)->count();
         if($oneHourPostCount > 5){
         if($oneHourPostCount > 5){
@@ -151,6 +155,7 @@ class PostRepositories
             }
             }
 
 
             DB::commit();
             DB::commit();
+            Redis::zadd('post_trigger_type', $isValid, $post->id);
             return jsonSuccess();
             return jsonSuccess();
 
 
         }catch (QueryException $exception){
         }catch (QueryException $exception){