wupengfei 2 年之前
父節點
當前提交
d91659e571

+ 9 - 7
.idea/workspace.xml

@@ -2,10 +2,12 @@
 <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/Press.php" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/operate/view/press/form.html" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/operate/view/press/index.html" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/operate/view/press/index_search.html" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/application/operate/view/press/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/api/controller/Forum.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Forum.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/api/controller/Report.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Report.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/common/model/UserReport.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common/model/UserReport.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -124,7 +126,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$/application/common/model" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/application/operate/view" />
     <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" />
@@ -135,11 +137,11 @@
   </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\common\model" />
       <recent name="D:\zs\gaoyixia\application\operate\view\forum" />
       <recent name="D:\zs\gaoyixia\application\api\controller" />
-      <recent name="D:\zs\gaoyixia\application\nutrition\view" />
-      <recent name="D:\zs\gaoyixia\application\nutrition\controller" />
     </key>
   </component>
   <component name="SvnConfiguration">
@@ -203,7 +205,7 @@
       <workItem from="1662342663926" duration="3749000" />
       <workItem from="1662424055312" duration="8281000" />
       <workItem from="1662528828371" duration="14923000" />
-      <workItem from="1662597494801" duration="1407000" />
+      <workItem from="1662597494801" duration="4344000" />
     </task>
     <servers />
   </component>

+ 88 - 0
application/operate/controller/Press.php

@@ -0,0 +1,88 @@
+<?php
+namespace app\operate\controller;
+use library\Controller;
+use think\Db;
+/**
+ * 新闻
+ * Class Press
+ * @package app\operate\controller
+ */
+class Press extends Controller
+{
+    protected $table = 'Press';
+
+    /**
+     * 列表
+     * @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 = '列表';
+        $where = [];
+        $where[] = ['f.is_deleted','=',0];
+        if($title = input('title')) $where[] = ['f.title','like','%'.$title.'%'];
+        $query = $this->_query($this->table)->alias('f')
+            ->field('f.*')
+            ->where($where)
+            ->order('f.id desc,sort desc')->page();
+    }
+
+
+
+    /**
+     * 删除
+     * @auth true
+     * @throws \think\Exception
+     * @throws \think\exception\PDOException
+     */
+    public function del()
+    {
+        $this->_save($this->table, ['is_deleted' => '1']);
+    }
+
+
+    /**
+     * 回复
+     * @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 reply()
+    {
+        $this->title = '回复列表';
+        $where = [];
+        $where[] = ['r.is_deleted','=',0];
+        $where[] = ['r.forum_id','=',input('id')];
+        if($title = input('content')) $where[] = ['r.content','like','%'.$title.'%'];
+        if($name = input('name')) $where[] = ['u.name','like','%'.$name.'%'];
+        if($phone = input('phone')) $where[] = ['u.phone','=',$phone];
+        $list = $this->_query('forum_reply')
+            ->alias('r')
+            ->field('r.*,u.name,u.phone,u.headimg')
+            ->leftJoin('store_member u','u.id = r.user_id')
+            ->where($where)
+            ->order('r.id desc')->page();
+        $this->assign('list',$list);
+        $this->fetch('');
+    }
+
+
+    public function del_reply()
+    {
+        Db::name('forum_reply')->where('id',input('id'))->update(['is_deleted'=>1]);
+        $this->success('删除成功');
+    }
+
+
+}

+ 64 - 0
application/operate/view/press/form.html

@@ -0,0 +1,64 @@
+<style>
+    .uploadimage{
+        width: 10pc !important;
+    }
+</style>
+<div class="think-box-shadow">
+    <form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
+        <div class="layui-card-body">
+
+            <div class="layui-form-item">
+                <label class="layui-form-label label-required">名称</label>
+                <div class="layui-input-block">
+                    <input name="name" maxlength="20"  value='{$vo.name|default=""}' placeholder="请输入名称" class="layui-input">
+                </div>
+            </div>
+
+            <div class="layui-form-item">
+                <label class="layui-form-label label-required">位置</label>
+                <div class="layui-input-block">
+                    <select name="place" >
+                        {foreach $place_desc as $pk=>$pv}
+                            {if isset($vo.place) && $vo.place == $pk}
+                                <option selected value="{$pk}">{$pv}</option>
+                            {else}
+                                <option value="{$pk}">{$pv}</option>
+                            {/if}
+                        {/foreach}
+                    </select>
+                </div>
+            </div>
+            <div class="layui-form-item">
+                <label class="layui-form-label label-required">图片</label>
+                <div class="layui-input-block">
+                    <input name="cover" type="hidden" value="{$vo.cover|default=''}">
+                    &nbsp; &nbsp;<span style="margin-right: 20px">建议尺寸宽700px 高330px </span>
+                </div>
+
+            </div>
+
+            <div class="layui-form-item">
+                <label class="layui-form-label label-required">链接</label>
+                <div class="layui-input-block">
+                    <input  name="link"  value='{$vo.link|default=""}' placeholder="请输入链接" class="layui-input">
+                </div>
+            </div>
+
+            <div class="layui-form-item">
+                <label class="layui-form-label label-required">排序</label>
+                <div class="layui-input-block">
+                    <input type="number" name="sort"  value='{$vo.sort|default=""}' placeholder="请输入排序号" class="layui-input">
+                </div>
+            </div>
+            {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
+            <div class="layui-form-item text-center">
+                <button class="layui-btn" type='submit'>保 存</button>
+                <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定取消编辑吗?" data-close>取消编辑</button>
+            </div>
+        </div>
+    </form>
+    <script>
+        window.form.render();
+        $('[name="cover"]').uploadOneImage();
+    </script>
+</div>

+ 54 - 0
application/operate/view/press/index.html

@@ -0,0 +1,54 @@
+{extend name='admin@main'}
+{block name="content"}
+<div class="think-box-shadow">
+    {include file='press/index_search'}
+    <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" style="width: 20%">操作</th>
+        </tr>
+        </thead>
+        <tbody>
+        {foreach $list as $key=>$vo}
+        <tr>
+            <td class='text-left nowrap'>{$vo.title|default='--'}</td>
+            <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("reply")}?id={$vo.id}'>查看回复</a>
+                <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/"+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}
+
+
+

+ 28 - 0
application/operate/view/press/index_search.html

@@ -0,0 +1,28 @@
+<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="title" value="{$Think.get.title|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/press/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}
+
+
+