wupengfei 2 years ago
parent
commit
0e9f698c87

+ 8 - 7
.idea/workspace.xml

@@ -2,11 +2,12 @@
 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="aa">
+      <change afterPath="$PROJECT_DIR$/application/operate/controller/PressComment.php" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/operate/view/press_comment/form.html" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/operate/view/press_comment/index.html" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/operate/view/press_comment/index_search.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/api/controller/Order.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Order.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/operate/view/demand_comment/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/demand_comment/form.html" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/operate/view/demand_comment/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/demand_comment/index.html" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/operate/view/demand_comment/index_search.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/demand_comment/index_search.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/view/press/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/press/index.html" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -123,7 +124,7 @@
   <component name="PropertiesComponent">
     <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
     <property name="WebServerToolWindowFactoryState" value="false" />
-    <property name="last_opened_file_path" value="D:/qianchen/ajing" />
+    <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" />
@@ -134,8 +135,8 @@
   </component>
   <component name="RecentsManager">
     <key name="CopyFile.RECENT_KEYS">
-      <recent name="D:\zs\gaoyixia\application\operate\view" />
       <recent name="D:\zs\gaoyixia\application\operate\controller" />
+      <recent name="D:\zs\gaoyixia\application\operate\view" />
       <recent name="D:\zs\gaoyixia\application\nutrition\view" />
       <recent name="D:\zs\gaoyixia\application\nutrition\controller" />
       <recent name="D:\zs\gaoyixia\application\operate\view\activity" />
@@ -187,7 +188,7 @@
       <workItem from="1667522664245" duration="25113000" />
       <workItem from="1667631256520" duration="624000" />
       <workItem from="1667700413254" duration="650000" />
-      <workItem from="1667782045788" duration="11505000" />
+      <workItem from="1667782045788" duration="12480000" />
     </task>
     <servers />
   </component>

+ 96 - 0
application/operate/controller/PressComment.php

@@ -0,0 +1,96 @@
+<?php
+namespace app\operate\controller;
+use library\Controller;
+/**
+ * 需求评论
+ * Class PressComment
+ * @package app\operate\controller
+ */
+class PressComment extends Controller
+{
+    /**
+     * 绑定数据表
+     * @var string
+     */
+    protected $table = 'PressComment';
+    /**
+     * 列表
+     * @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.'%'];
+        $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('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'];
+        }
+    }
+
+
+
+
+}

+ 3 - 1
application/operate/view/press/index.html

@@ -27,7 +27,9 @@
             <td class='text-left'>{$vo.create_at|default='--'}</td>
             <td class='text-left' style="width: 20%">
                 <a data-title="编辑" class="layui-btn layui-btn-sm" data-open='{:url("edit")}?id={$vo.id}'>编 辑</a>
-                <a data-title="查看回复" class="layui-btn layui-btn-sm" data-open='{:url("reply")}?id={$vo.id}'>查看回复</a>
+              
+                <span data-title="评论" class="layui-btn layui-btn-sm" data-open='{:url("/operate/press_comment/index")}?first_id={$vo.id}'>评 论</span>
+
                 <span class="layui-btn layui-btn-sm layui-btn-danger" onclick="btn_confirm('删除','del','{$vo.id}');">删 除</span>
             </td>
         </tr>

+ 27 - 0
application/operate/view/press_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>

+ 63 - 0
application/operate/view/press_comment/index.html

@@ -0,0 +1,63 @@
+{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='press_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%">
+                <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/demand_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}
+
+
+

+ 24 - 0
application/operate/view/press_comment/index_search.html

@@ -0,0 +1,24 @@
+<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>