Browse Source

添加内容ID跟作者ID筛选

durong 5 years ago
parent
commit
22684e93d0

+ 3 - 0
app/Http/Controllers/Behavior/CommentRecordController.php

@@ -58,6 +58,9 @@ class CommentRecordController extends Controller
                 'uid',
                 'created_at',
                 'trigger_type',
+                'content_author_id',
+                'related_content_id',
+                'superior_commentator_id',
                 'virus_behavior_id'
             ],
             'columns' => [

+ 3 - 0
app/Http/Controllers/Behavior/GeneralRecordController.php

@@ -61,6 +61,9 @@ class GeneralRecordController extends Controller
                 'uid',
                 'created_at',
                 'trigger_type',
+                'content_author_id',
+                'related_content_id',
+                'behavior_identification',
                 'virus_behavior_id'
             ],
             'columns' => [

+ 2 - 1
app/Http/Controllers/Behavior/ReleaseRecordController.php

@@ -57,7 +57,8 @@ class ReleaseRecordController extends Controller
                 'id',
                 'uid',
                 'created_at',
-                'trigger_type'
+                'trigger_type',
+                'related_content_id'
             ],
             'columns' => [
                 'id',

+ 9 - 0
app/Repositories/Behavior/CommentRecordRepository.php

@@ -32,6 +32,15 @@ class CommentRecordRepository
         if(isset($request['virus_behavior_id'])){
             $where[] = ['virus_behavior_id', $request['virus_behavior_id']];
         }
+        if(isset($request['content_author_id'])){
+            $where[] = ['content_author_id', $request['content_author_id']];
+        }
+        if(isset($request['related_content_id'])){
+            $where[] = ['related_content_id', $request['related_content_id']];
+        }
+        if(isset($request['superior_commentator_id'])){
+            $where[] = ['superior_commentator_id', $request['superior_commentator_id']];
+        }
 
         return $this->commentRecord
             ->where($where)

+ 6 - 0
app/Repositories/Behavior/GenaralRecordRepository.php

@@ -34,6 +34,12 @@ class GenaralRecordRepository
         if(isset($request['virus_behavior_id'])){
             $where[] = ['virus_behavior_id', $request['virus_behavior_id']];
         }
+        if(isset($request['content_author_id'])){
+            $where[] = ['content_author_id', $request['content_author_id']];
+        }
+        if(isset($request['related_content_id'])){
+            $where[] = ['related_content_id', $request['related_content_id']];
+        }
 
         if(isset($request['behavior_identification'])){
             $virus_id = $this->behavior->select('virus_behavior_id')->where('behavior_identification',$request['behavior_identification'])->first();

+ 3 - 0
app/Repositories/Behavior/ReleaseRecordRepository.php

@@ -32,6 +32,9 @@ class ReleaseRecordRepository
         if(isset($request['virus_behavior_id'])){
             $where[] = ['virus_behavior_id', $request['virus_behavior_id']];
         }
+        if(isset($request['related_content_id'])){
+            $where[] = ['related_content_id', $request['related_content_id']];
+        }
 
         return $this->releaseRecord
             ->where($where)