wupengfei 2 年之前
父节点
当前提交
ff6e62f4e5

+ 8 - 7
.idea/workspace.xml

@@ -3,7 +3,8 @@
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/config/app.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/app.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/controller/PressComment.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/controller/PressComment.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/view/press_comment/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/press_comment/index.html" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -132,6 +133,11 @@
     <property name="two.files.diff.last.used.folder" value="$PROJECT_DIR$" />
   </component>
   <component name="RecentsManager">
+    <key name="MoveFile.RECENT_KEYS">
+      <recent name="D:\zs\gaoyixia\public" />
+      <recent name="D:\zs\gaoyixia\public\wx_cert" />
+      <recent name="D:\zs\gaoyixia\application\api\controller" />
+    </key>
     <key name="CopyFile.RECENT_KEYS">
       <recent name="D:\zs\gaoyixia\public\wx_cert" />
       <recent name="D:\zs\gaoyixia\application\user\view\member" />
@@ -139,11 +145,6 @@
       <recent name="D:\zs\gaoyixia\application\common\service" />
       <recent name="D:\zs\gaoyixia\application\synth\view\bill_header" />
     </key>
-    <key name="MoveFile.RECENT_KEYS">
-      <recent name="D:\zs\gaoyixia\public" />
-      <recent name="D:\zs\gaoyixia\public\wx_cert" />
-      <recent name="D:\zs\gaoyixia\application\api\controller" />
-    </key>
   </component>
   <component name="SvnConfiguration">
     <configuration />
@@ -215,7 +216,7 @@
       <workItem from="1673052319155" duration="16867000" />
       <workItem from="1673226266250" duration="24113000" />
       <workItem from="1673312216057" duration="9503000" />
-      <workItem from="1673399011843" duration="1827000" />
+      <workItem from="1673399011843" duration="8796000" />
     </task>
     <servers />
   </component>

+ 12 - 1
application/operate/controller/PressComment.php

@@ -35,7 +35,7 @@ class PressComment extends Controller
         $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();
+            ->where($sel_where)->order('is_top desc,id desc')->page();
     }
 
     /**
@@ -90,6 +90,17 @@ class PressComment extends Controller
         }
     }
 
+    /**
+     * 置顶设置
+     * @auth true
+     * @menu true
+     * @param array $data
+     */
+    public function stick()
+    {
+        $this->_save($this->table, ['is_top' => input('is_top')]);
+    }
+
 
 
 

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

@@ -27,6 +27,11 @@
             <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.status) and $vo.status eq 1}
+                <a class="layui-btn layui-btn-sm" data-action="{:url('stick')}" data-value="id#{$vo.id};is_top#0">取消置顶</a>
+                {else}
+                <a class="layui-btn layui-btn-sm 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>