wupengfei 1 年之前
父節點
當前提交
5e3b37d04f

+ 8 - 3
.idea/workspace.xml

@@ -2,9 +2,14 @@
 <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/SupplierComment.php" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/operate/view/supplier_comment/form.html" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/operate/view/supplier_comment/index.html" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/operate/view/supplier_comment/index_search.html" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/operate/view/supplier_comment/reply.html" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/nutrition/controller/DatumComment.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/DatumComment.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/nutrition/view/datum_comment/index_search.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/datum_comment/index_search.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/view/comment_report/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/comment_report/index.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/controller/DemandComment.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/controller/DemandComment.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -314,7 +319,7 @@
       <workItem from="1683680449159" duration="24035000" />
       <workItem from="1683766597228" duration="22109000" />
       <workItem from="1683852930702" duration="24375000" />
-      <workItem from="1684112329391" duration="10867000" />
+      <workItem from="1684112329391" duration="11247000" />
     </task>
     <servers />
   </component>

+ 1 - 0
application/nutrition/view/comment_report/index.html

@@ -87,6 +87,7 @@
                 {eq name='vo.type' value='2'}<span class="layui-btn layui-btn-sm"  data-open='{:url("nutrition/video_comment/index")}?video_id={$vo.be_report.first_id}&url_id={$vo.be_report.second_id}&id={$vo.report_id}&r=1'>查看评论</span>{/eq}
                 {eq name='vo.type' value='8'}<span class="layui-btn layui-btn-sm"  data-open='{:url("nutrition/article_comment/index")}?article_id={$vo.be_report.first_id}&item_id={$vo.be_report.second_id}&id={$vo.report_id}&r=1'>查看评论</span>{/eq}
                 {eq name='vo.type' value='10'}<span class="layui-btn layui-btn-sm"  data-open='{:url("nutrition/datum_comment/index")}?datum_id={$vo.be_report.first_id}&url_id={$vo.be_report.second_id}&id={$vo.report_id}&r=1'>查看评论</span>{/eq}
+                {eq name='vo.type' value='14'}<span class="layui-btn layui-btn-sm"  data-open='{:url("operate/supplier_comment/index")}?goods_id={$vo.be_report.first_id}&id={$vo.report_id}&r=1'>查看评论</span>{/eq}
 
                 {if !$vo.reply}
                 <span class="layui-btn layui-btn-sm layui-btn-warm"  data-modal='{:url("edit")}?id={$vo.id}'>回 复</span>

+ 1 - 1
application/operate/controller/DemandComment.php

@@ -25,7 +25,7 @@ class DemandComment extends Controller
      */
     public function index()
     {
-        $this->title = '视频列表';
+        $this->title = '列表';
         $this->first_id = input('first_id');
         $sel_where = [];
         $sel_where[] = ['c.is_deleted','=',0];

+ 106 - 0
application/operate/controller/SupplierComment.php

@@ -0,0 +1,106 @@
+<?php
+namespace app\operate\controller;
+use library\Controller;
+/**
+ * 评论
+ * Class SupplierComment
+ * @package app\operate\controller
+ */
+class SupplierComment extends Controller
+{
+    /**
+     * 绑定数据表
+     * @var string
+     */
+    protected $table = 'SupplierComment';
+    /**
+     * 列表
+     * @auth true
+     * @menu true
+     * @throws \think\Exception
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     * @throws \think\exception\PDOException
+     */
+    public function index()
+    {
+        $this->title = '列表';
+        $this->first_id = input('first_id');
+        $sel_where = [];
+        $sel_where[] = ['c.is_deleted','=',0];
+        $sel_where[] = ['c.first_id','=',$this->first_id];
+        if($content = $this->request->get('content'))$sel_where[] = ['c.content','like','%'.$content.'%'];
+        if($name = $this->request->get('name'))$sel_where[] = ['u.name','like','%'.$name.'%'];
+        if($id= $this->request->get('id'))$sel_where[] = ['c.id','=',$this->request->get('id')];
+        $query = $this->_query($this->table)->alias('c')
+            ->field('c.*,u.name,u.headimg')
+            ->leftJoin("store_member u",'u.id = c.user_id')
+            ->where($sel_where)->order('is_top desc,id desc')->page();
+    }
+
+    /**
+     * 数据列表处理
+     * @auth true
+     * @menu true
+     * @param array $data
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     */
+    protected function _index_page_filter(&$data)
+    {
+
+
+    }
+
+    // 回复
+    public function reply()
+    {
+        $this->title = '回复';
+        $this->_form($this->table, 'form');
+    }
+
+
+    /**
+     * 删除
+     * @auth true
+     * @menu true
+     * @throws \think\Exception
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     * @throws \think\exception\PDOException
+     */
+    public function del()
+    {
+        $this->_save($this->table, ['is_deleted' => 1]);
+    }
+
+
+    /**
+     * 表单数据处理
+     * @auth true
+     * @menu true
+     * @param array $data
+     */
+    protected function _form_filter(&$data)
+    {
+        if($this->request->isGet()) {
+            $this->source_id = $data['source_id'] ? $data['source_id'] : $data['id'];
+        }
+    }
+
+    /**
+     * 置顶设置
+     * @auth true
+     * @menu true
+     * @param array $data
+     */
+    public function stick()
+    {
+        $this->_save($this->table, ['is_top' => input('is_top')]);
+    }
+
+
+}

+ 27 - 0
application/operate/view/supplier_comment/form.html

@@ -0,0 +1,27 @@
+<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">
+                <textarea name="content" rows="10" cols="100"></textarea>
+            </label>
+        </div>
+        <input type="hidden" name="first_id" value="{$vo.first_id|default=0}">
+        <input type="hidden" name="lev" value="{$vo.lev + 1}">
+        <input type="hidden" name="pid" value="{$vo.id}">
+        <input type="hidden" name="source_id" value="{$source_id}">
+    </div>
+
+    <div class="hr-line-dashed"></div>
+    <div class="layui-form-item text-center">
+
+
+        <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>

+ 68 - 0
application/operate/view/supplier_comment/index.html

@@ -0,0 +1,68 @@
+{extend name='admin@main'}
+{block name="button"}
+<a href="javascript:history.go(-1);"  data-title="返 回" class='layui-btn layui-btn-sm layui-btn-primary'>返 回</a>
+{/block}
+{block name="content"}
+<div class="think-box-shadow">
+    {include file='demand_comment/index_search'}
+    <table class="layui-table margin-top-20" lay-skin="line">
+        <thead>
+        <tr>
+            <th class='text-left nowrap' >用户</th>
+            <th class='text-left ' style="width: 60%">评论内容</th>
+            <th class='text-left nowrap' >时间</th>
+            <th class="text-left nowrap">操作</th>
+        </tr>
+        </thead>
+        <tbody>
+        {foreach $list as $key=>$vo}
+        <tr>
+            <td class='text-left nowrap'>
+                <img data-tips-image style="width:50px;height:50px" src="{$vo.headimg|default=''}" class="margin-right-5 text-top">
+                <div class="inline-block">
+                    用户ID:{$vo.user_id|default='--'}<br>
+                    用户昵称:{$vo.name|default='后台回复'}
+                </div>
+            </td>
+            <td class='text-left '>{$vo.content|default=''}</td>
+            <td class='text-left nowrap'>{$vo.create_at|default=''}</td>
+            <td class='text-left' style="width: 20%">
+                {if isset($vo.is_top) and $vo.is_top eq 1}
+                <a class="layui-btn layui-btn-xs" data-action="{:url('stick')}" data-value="id#{$vo.id};is_top#0">取消置顶</a>
+                {else}
+                <a class="layui-btn layui-btn-xs layui-btn-warm" data-action="{:url('stick')}" data-value="id#{$vo.id};is_top#1">置 顶</a>
+                {/if}
+                <a data-title="回 复" class="layui-btn layui-btn-xs" data-modal='{:url("reply")}?id={$vo.id}'>回 复</a>
+                <span class="layui-btn layui-btn-xs 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/supplier_comment/"+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}
+
+
+

+ 29 - 0
application/operate/view/supplier_comment/index_search.html

@@ -0,0 +1,29 @@
+<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">ID</label>
+            <div class="layui-input-inline">
+                <input name="id" maxlength="60"  value='{$Think.get.id|default=""}' placeholder="请输入ID" 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="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>

+ 93 - 0
application/operate/view/supplier_comment/reply.html

@@ -0,0 +1,93 @@
+{extend name='admin@main'}
+{block name="button"}
+<a href="javascript:history.go(-1);"  data-title="返 回" class='layui-btn layui-btn-sm layui-btn-primary'>返 回</a>
+{/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="phone" value="{$Think.get.phone|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-20" lay-skin="line">
+        <thead>
+        <tr>
+            <th class='text-left nowrap'>回复会员</th>
+            <th class='text-left '>内容</th>
+            <th class='text-left '>时间</th>
+            <th class="text-left" style="width: 20%">操作</th>
+        </tr>
+        </thead>
+        <tbody>
+        {foreach $list as $key=>$vo}
+        <tr>
+            <td class='text-left nowrap'>
+                <img data-tips-image style="width:50px;height:50px" src="{$vo.headimg|default=''}" class="margin-right-5 text-top">
+                <div class="inline-block">
+                    用户ID:{$vo.user_id|default='--'}<br>
+                    用户昵称:{$vo.name|default='--'}<br>
+                    电话:{$vo.phone|default='--'}
+                </div>
+            </td>
+             <td class='text-left'>{$vo.content|default='--'}</td>
+            <td class='text-left nowrap'>{$vo.create_at|default='--'}</td>
+            <td class='text-left' style="width: 20%">
+                <span class="layui-btn layui-btn-sm layui-btn-danger" onclick="btn_confirm('删除','del_reply','{$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/forum/"+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}
+
+
+