bianjunhui 16 hours ago
parent
commit
9fb1db5dd9
2 changed files with 14 additions and 1 deletions
  1. 12 0
      application/api/controller/Apmessage.php
  2. 2 1
      public/assets/js/backend/message.js

+ 12 - 0
application/api/controller/Apmessage.php

@@ -172,7 +172,19 @@ class Apmessage extends Api
         }
         }
         $this->success('',$data);
         $this->success('',$data);
     }
     }
+    public function addRead(){
+        $post=$this->request->post();
+        $where['id']=$post['message_id'];
+        $list =Db::name('message')->where($where)->find();
+        if(empty($list)){
+            $this->error('not exit!');
+        }
+        $data['page_view']=$list['page_view']+1;
+        $data['uptime']=time();
+        Db::name('message')->where($where)->update($data);
+        $this->success();
 
 
+    }
     public function upRead(){
     public function upRead(){
         $post=$this->request->post();
         $post=$this->request->post();
         if($post['type']==1){//单条阅读
         if($post['type']==1){//单条阅读

+ 2 - 1
public/assets/js/backend/message.js

@@ -33,7 +33,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'group_id', title: __('Group_id')},
                         {field: 'group_id', title: __('Group_id')},
                         {field: 'group_name', title: __('Group_name'), operate: 'LIKE'},
                         {field: 'group_name', title: __('Group_name'), operate: 'LIKE'},
                         {field: 'type', title: __('Type'), searchList: {0: __('url'), 2: __('订单列表'), 3: __('商品详情'), 4: __('购物车'), 5: __('消息列表'), 1: __('商品列表'), 6: __('explore首页'), 7: __('explore详情'), 8: __('我的积分'), 9: __('koc'), 10: __('vip Center'), 11: __('我的优惠券'), 12: __('登录注册'), 13: __('签到'), 14: __('首页')}, operate: false, formatter: Table.api.formatter.status,},
                         {field: 'type', title: __('Type'), searchList: {0: __('url'), 2: __('订单列表'), 3: __('商品详情'), 4: __('购物车'), 5: __('消息列表'), 1: __('商品列表'), 6: __('explore首页'), 7: __('explore详情'), 8: __('我的积分'), 9: __('koc'), 10: __('vip Center'), 11: __('我的优惠券'), 12: __('登录注册'), 13: __('签到'), 14: __('首页')}, operate: false, formatter: Table.api.formatter.status,},
-                        {field: 'counts', title: __('点击次数')},
+                        {field: 'page_view', title: __('点击次数')},
+                        {field: 'counts', title: __('已读次数')},
                         {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'sendtime', title: __('Sendtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'sendtime', title: __('Sendtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
                         {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},