wupengfei 2 years ago
parent
commit
32843f2f04

+ 16 - 1
application/user/controller/UserReport.php

@@ -3,6 +3,9 @@
 
 namespace app\user\controller;
 
+use app\common\model\User;
+use app\common\model\VideoComment;
+use app\common\model\VideoIntro;
 use library\Controller;
 use think\Db;
 
@@ -25,7 +28,7 @@ class UserReport extends Controller
     {
         $this->title = '举报列表';
         $where= [];
-        if($this->request->request('phone'))  $where[]= ['m.phone','=',$this->request->request('phone')];
+        if($this->request->request('name'))  $where[]= ['m.name','like','%'.$this->request->request('name').'%'];
         $where[]= ['f.is_deleted','=',0];
         $query = $this->_query($this->table);
         $query->alias('f')
@@ -44,6 +47,18 @@ class UserReport extends Controller
     {
         array_walk($data,function (&$val,$key){
             $val['report_arr'] = \app\common\model\ReportCase::where('id','in',$val['case_ids'])->column('title');
+            switch ($val['type'])
+            {
+                case 1:
+                    $v['object'] = VideoIntro::where('id',$val['report_id'])->column('id,cover,video_url,title');
+                    break;
+                case 2:
+                    $v['object'] = VideoComment::where('id',$val['report_id'])->column('id,content,create_at');
+                    break;
+                case 3:
+                    $v['object'] = User::where('id',$val['report_id'])->column('id,headimg,name');
+                    break;
+            }
         });
 
     }

+ 43 - 7
application/user/view/user_report/index.html

@@ -7,10 +7,11 @@
         <thead>
         <tr>
             <th class='text-left nowrap'>用户</th>
+            <th class='text-left nowrap'>类型</th>
             <th class='text-left nowrap'>举报标的</th>
-            <th class='text-left nowrap'>举报内容</th>
-            <th class="text-center nowrap">举报时间</th>
-            <th class="text-center nowrap">操作</th>
+            <th class='text-left nowrap' style="width: 30%">举报内容</th>
+            <th class="text-left nowrap">举报时间</th>
+            <th class="text-left nowrap">操作</th>
         </tr>
         </thead>
         {/notempty}
@@ -22,11 +23,32 @@
                 <img data-tips-image style="width:60px;height:60px" src="{$vo.headimg|default=''}" class="margin-right-5 text-top">
                 {/notempty}
                 <div class="inline-block">
-                    用户ID:{$vo.user_id|default='--'}<br>
-                    用户名:{$vo.name|default='--'}<br>
+                    用户ID:{$vo.user_id|default='--'}<br/><br/>
+                    用户名:{$vo.name|default='--'}
                 </div>
             </td>
-            <td class='text-left nowrap'>{$vo.report_id|default='--'}</td>
+            <td class='text-left nowrap'>
+                {eq name='vo.type' value='1'}视频{/eq}
+                {eq name='vo.type' value='2'}评论{/eq}
+                {eq name='vo.type' value='3'}会员{/eq}
+            </td>
+            <td class='text-left nowrap'>
+                {eq name='vo.type' value='1'}
+                <img  class="video_player"  alert="点击播放"   src="{$vo.object.cover|default=''}" data-src="{$vo.object.video_url|default=''}" style="height: 50px;width: 75px" />
+                {/eq}
+
+                {eq name='vo.type' value='2'}{$vo.object.content}{/eq}
+
+                {eq name='vo.type' value='3'}
+                    {notempty name='vo.headimg'}
+                    <img data-tips-image style="width:60px;height:60px" src="{$vo.object.headimg|default=''}" class="margin-right-5 text-top">
+                    {/notempty}
+                    <div class="inline-block">
+                        用户ID:{$vo.object.id|default='--'}<br/><br/>
+                        用户名:{$vo.object.name|default='--'}
+                    </div>
+                {/eq}
+            </td>
 
             <td class='text-left nowrap padding-0 relative'>
                 <div style="overflow:auto;max-height:68px;padding:5px 0">
@@ -50,7 +72,7 @@
 <script>
     function btn_confirm(msg,fun,id) {
         layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
-            var url = "/user/user_feedback/"+fun;
+            var url = "/user/user_report/"+fun;
             layer.closeAll();
             $.ajax({
                 type: "post",
@@ -67,5 +89,19 @@
             });
         });
     }
+
+    $('.video_player').click(function () {
+        vUrl = $(this).data('src');  //获取到播放的url
+        var loadstr = '<video width="100%" height="100%"  controls="controls" autobuffer="autobuffer"  autoplay="autoplay" loop="loop">' +
+            '<source src='+vUrl+' type="video/mp4"></source></video>';
+        layer.open({
+            type: 1,
+            title: false,
+            area: ['730px', '500px'],
+            shade: [0.8, 'rgb(14, 16, 22)'],
+            skin: 'demo-class',
+            content: loadstr
+        });
+    });
 </script>
 {/block}

+ 2 - 2
application/user/view/user_report/index_search.html

@@ -3,9 +3,9 @@
     <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
 
         <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">手机号</label>
+            <label class="layui-form-label">用户名</label>
             <div class="layui-input-inline">
-                <input name="phone" value="{$Think.get.phone|default=''}" placeholder="请输入手机号" class="layui-input">
+                <input name="name" value="{$Think.get.name|default=''}" placeholder="请输入用户名" class="layui-input">
             </div>
         </div>