wupengfei 1 year ago
parent
commit
158f4d3690

+ 12 - 9
.idea/workspace.xml

@@ -2,6 +2,9 @@
 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
+      <change afterPath="$PROJECT_DIR$/application/operate/controller/ActivityReport.php" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/operate/view/activity_report/form.html" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/operate/view/activity_report/index.html" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
@@ -137,7 +140,7 @@
     <property name="WebServerToolWindowPanel.toolwindow.show.date" value="false" />
     <property name="WebServerToolWindowPanel.toolwindow.show.permissions" value="false" />
     <property name="WebServerToolWindowPanel.toolwindow.show.size" value="false" />
-    <property name="last_opened_file_path" value="$PROJECT_DIR$/public/static" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/application/operate/controller" />
     <property name="node.js.detected.package.eslint" value="true" />
     <property name="node.js.detected.package.tslint" value="true" />
     <property name="node.js.path.for.package.eslint" value="project" />
@@ -148,13 +151,6 @@
     <property name="two.files.diff.last.used.folder" value="$PROJECT_DIR$" />
   </component>
   <component name="RecentsManager">
-    <key name="CopyFile.RECENT_KEYS">
-      <recent name="D:\zs\gaoyixia\public\static" />
-      <recent name="D:\zs\gaoyixia\application\common\service" />
-      <recent name="D:\zs\gaoyixia\application\operate\view\recruit_cate" />
-      <recent name="D:\zs\gaoyixia\application\operate\view" />
-      <recent name="D:\zs\gaoyixia\application\operate\controller" />
-    </key>
     <key name="MoveFile.RECENT_KEYS">
       <recent name="D:\zs\gaoyixia\public" />
       <recent name="D:\zs\gaoyixia\public\static" />
@@ -162,6 +158,13 @@
       <recent name="D:\zs\gaoyixia\public\a" />
       <recent name="D:\zs\gaoyixia\application\api\controller" />
     </key>
+    <key name="CopyFile.RECENT_KEYS">
+      <recent name="D:\zs\gaoyixia\application\operate\controller" />
+      <recent name="D:\zs\gaoyixia\application\operate\view" />
+      <recent name="D:\zs\gaoyixia\public\static" />
+      <recent name="D:\zs\gaoyixia\application\common\service" />
+      <recent name="D:\zs\gaoyixia\application\operate\view\recruit_cate" />
+    </key>
   </component>
   <component name="SvnConfiguration">
     <configuration />
@@ -383,7 +386,7 @@
       <workItem from="1690419501541" duration="21049000" />
       <workItem from="1690505259271" duration="15651000" />
       <workItem from="1690592199498" duration="13486000" />
-      <workItem from="1690764472148" duration="11388000" />
+      <workItem from="1690764472148" duration="12096000" />
     </task>
     <servers />
   </component>

+ 93 - 0
application/operate/controller/ActivityReport.php

@@ -0,0 +1,93 @@
+<?php
+namespace app\operate\controller;
+use app\common\model\DatumIntro;
+use app\common\model\UserForum;
+use library\Controller;
+use think\Db;
+
+/**
+ * 举报
+ * Class ActivityReport
+ * @package app\operate\controller
+ */
+class ActivityReport extends Controller
+{
+    protected  $table ="UserReport";
+
+
+    /**
+     * 反馈变更列表
+     * @auth true
+     * @menu true
+     */
+    public function index()
+    {
+        $this->title = '举报列表';
+        $where= [];
+        if($this->request->request('name'))      $where[]= ['m.name','like','%'.$this->request->request('name').'%'];
+        if($this->request->request('content'))      $where[]= ['f.content','like','%'.$this->request->request('content').'%'];
+        $where[]= ['f.is_deleted','=',0];
+        $where[]= ['f.type','=',15];
+        $query = $this->_query($this->table);
+        $query->alias('f')
+            ->field('f.* ,m.headimg,m.name')
+            ->join('store_member m',' m.id = f.user_id ','LEFT');
+        if(!empty($where)) $query->where($where);
+        $query ->order('f.id desc')->page();
+    }
+    /**反馈列表处理
+     * @param array $data
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     */
+    protected function _index_page_filter(array &$data)
+    {
+        array_walk($data,function (&$val,$key){
+            $val['report_arr'] = \app\common\model\ReportCase::where('id','in',$val['case_ids'])->column('title');
+            $object_info = \app\common\model\Activity::where('id',$val['report_id'])->find();
+            $object_info = $object_info ? $object_info->toArray() : ['title'=>'--'];
+            $val['object_title'] = $object_info['title'];
+        });
+
+    }
+    /**
+     * 删除
+     * @auth true
+     * @menu true
+     */
+    public function del()
+    {
+        $this->_save($this->table, ['is_deleted' => 1]);
+    }
+
+    /**
+     * 批量删除
+     * @auth true
+     * @menu true
+     */
+    public function remove()
+    {
+        $this->_save($this->table, ['is_deleted' => 1]);
+    }
+
+    /**
+     * 回复
+     * @auth true
+     * @menu true
+     */
+    public function edit()
+    {
+        $this->title = '回复';
+        $this->_form($this->table,'form');
+    }
+
+    protected function _form_filter(&$data)
+    {
+        if($this->request->action() == 'edit' && $this->request->isGet())
+        {
+            $data['title'] = \app\common\model\Press::where('id',$data['report_id'])->value('title');
+        }
+    }
+
+}

+ 30 - 0
application/operate/view/activity_report/form.html

@@ -0,0 +1,30 @@
+<form onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">
+
+    <div class="layui-card-body">
+
+        <div class="layui-row margin-bottom-15">
+            <label class="layui-col-xs2 think-form-label">举报标题:</label>
+            <label class="layui-col-xs10">
+                <input value="{$vo.title}" class="layui-input" />
+            </label>
+        </div>
+
+        <div class="layui-row margin-bottom-15">
+            <label class="layui-col-xs2 think-form-label">回复内容:</label>
+            <label class="layui-col-xs10">
+                <textarea name="reply" rows="10" cols="102">{$vo.reply|default=''}</textarea>
+            </label>
+        </div>
+
+    </div>
+
+    <div class="hr-line-dashed"></div>
+    <div class="layui-form-item text-center">
+        {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
+        <button class="layui-btn" type='submit'>提交</button>
+        <button class="layui-btn layui-btn-danger" type='button' data-close>取消</button>
+    </div>
+</form>
+<script>
+    window.form.render();
+</script>

+ 115 - 0
application/operate/view/activity_report/index.html

@@ -0,0 +1,115 @@
+{extend name='admin@main'}
+{block name="button"}
+
+<button data-action='{:url("remove")}'  data-confirm="确定要删除吗?" data-csrf="{:systoken('remove')}" data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</button>
+
+{/block}
+{block name="content"}
+<div class="think-box-shadow">
+
+    <fieldset>
+        <legend>条件搜索</legend>
+        <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>
+                <div class="layui-input-inline">
+                    <input name="name" value="{$Think.get.name|default=''}" placeholder="请输入用户名" class="layui-input">
+                </div>
+            </div>
+            <div class="layui-form-item layui-inline">
+                <label class="layui-form-label">内容</label>
+                <div class="layui-input-inline">
+                    <input name="content" value="{$Think.get.content|default=''}" placeholder="请输入举报内容" class="layui-input">
+                </div>
+            </div>
+
+            <div class="layui-form-item layui-inline">
+                <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
+            </div>
+        </form>
+        <script>form.render()</script>
+    </fieldset>
+
+
+    <table class="layui-table margin-top-10" lay-skin="line">
+        {notempty name='list'}
+        <thead>
+        <tr>
+            <th class='list-table-check-td think-checkbox'><input data-auto-none data-check-target='.list-check-box' type='checkbox'></th>
+            <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-left nowrap">举报时间</th>
+            <th class="text-left nowrap">操作</th>
+        </tr>
+        </thead>
+        {/notempty}
+        <tbody>
+        {foreach $list as $key=>$vo}
+        <tr>
+            <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
+            <td class='text-left nowrap'>
+                {notempty name='vo.headimg'}
+                <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/><br/>
+                    用户名:{$vo.name|default='--'}
+                </div>
+            </td>
+            <td class='text-left nowrap'>
+                <div class="inline-block">
+                    举报活动ID:{$vo.report_id|default='--'}<br/><br/>
+                    举报活动标题:{$vo.object_title}
+                </div>
+            </td>
+            <td class='text-left '>{$vo.content|default='--'}</td>
+            <td class='text-left  padding-0 relative'>
+                <div style="overflow:auto;max-height:68px;padding:5px 0">
+                    {foreach $vo.report_arr as $rv}
+                    <div class="layui-row" style="line-height:23px">
+                        <div class="layui-col-xs6 text-left layui-elip font-s10">{$rv}</div>
+                    </div>
+                    {/foreach}
+                </div>
+            </td>
+            <td class='text-left nowrap'>{$vo.create_at|default='--'}</td>
+            <td class='text-left nowrap'>
+                <span class="layui-btn layui-btn-sm"  data-open= '{:url("/operate/press/edit")}?id={$vo.report_id}&r=1'>查看活动</span>
+                {if !$vo.reply}
+                <span class="layui-btn layui-btn-sm layui-btn-warm"  data-modal='{:url("edit")}?id={$vo.id}'>回 复</span>
+                {else}
+                <span class="layui-btn layui-btn-sm "  data-modal='{:url("edit")}?id={$vo.id}'>查看回复</span>
+                {/if}
+                <span class="layui-btn layui-btn-sm layui-btn-danger" onclick="btn_confirm('删除','del','{$vo.id}');">删 除</span>
+            </td>
+        </tr>
+        {/foreach}
+        </tbody>
+    </table>
+    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
+</div>
+<script>
+    function btn_confirm(msg,fun,id) {
+        layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
+            var url = "/operate/press_report/"+fun;
+            layer.closeAll();
+            $.ajax({
+                type: "post",
+                url: url,
+                data: {id:id},
+                dataType: "json",
+                async: false,
+                success: function (data) {
+                    layer.msg(data.info);
+                    setTimeout(function () {
+                        window.location.reload();
+                    },1000)
+                }
+            });
+        });
+    }
+
+</script>
+{/block}