wupengfei 2 роки тому
батько
коміт
fc0be640ee

+ 1 - 7
.idea/workspace.xml

@@ -2,14 +2,8 @@
 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
-      <change afterPath="$PROJECT_DIR$/application/nutrition/view/top_search/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/Expedite.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Expedite.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/api/controller/Press.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Press.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/common/model/SearchStatistics.php" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/common/model/UserSearch.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common/model/UserSearch.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/application/nutrition/controller/TopSearch.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/TopSearch.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/nutrition/view/top_search/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/top_search/form.html" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/application/nutrition/view/top_search/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/top_search/index.html" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
@@ -232,7 +226,7 @@
       <workItem from="1665448772446" duration="594000" />
       <workItem from="1665451038308" duration="20434000" />
       <workItem from="1665535775245" duration="5105000" />
-      <workItem from="1665543789478" duration="4386000" />
+      <workItem from="1665543789478" duration="4635000" />
     </task>
     <servers />
   </component>

+ 13 - 0
application/nutrition/controller/TopSearch.php

@@ -29,6 +29,19 @@ class TopSearch extends Controller
     public function index()
     {
         $this->title = '热搜列表';
+        $this->type_desc = $type_desc = [
+            0=>"全部",
+            1=>'视频',
+            2=>'图文',
+            3=>'资料',
+            4=>'新闻',
+            5=>'需求',
+            6=>'论坛',
+            7=>'商品',
+            8=>'招聘',
+            9=>'供应商',
+            10=>'供应商产品',
+        ];
         $query = $this->_query($this->table)->where('is_deleted',0);
         $query->like('title');
         $query->order('sort desc, id desc')->page();

+ 4 - 0
application/nutrition/view/top_search/index.html

@@ -11,6 +11,8 @@
         <thead>
         <tr>
             <th class='text-left nowrap' style="width: 50%">标题</th>
+            <th class='text-left nowrap' >类型</th>
+            <th class='text-left nowrap' >搜索量</th>
             <th class='text-left nowrap' style="width: 25%">状态</th>
             <th class="text-left nowrap" style="width: 25%">操作</th>
         </tr>
@@ -19,6 +21,8 @@
         {foreach $list as $key=>$vo}
         <tr>
             <td class='text-left nowrap'>{$vo.title|default=''}</td>
+            <td class='text-left nowrap'>{$type_desc[$vo.type]|default='--'}</td>
+            <td class='text-left nowrap'>{$vo.num|default=''}</td>
             <td class='text-left nowrap'>{$vo.status == 1 ?'已启用' :'已禁用'}</td>
             <td class='text-left' >
                 <a data-title="编辑" class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>