Selaa lähdekoodia

修改时间格式和分页

bianjunhui 2 vuotta sitten
vanhempi
commit
b62d46877c
1 muutettua tiedostoa jossa 3 lisäystä ja 2 poistoa
  1. 3 2
      application/api/controller/Message.php

+ 3 - 2
application/api/controller/Message.php

@@ -97,16 +97,17 @@ class Message extends Api
     public function getMessage(){
         $post=$this->request->post();
         $user = User::getByUserId($post['user_id']);
+        $config['page']=$post['page'];
         $data=array();
         if($user){
             $wheres['group_id']=$user->group_id;
             $wheres['status']=2;
-            $list = Db::name('message')->where($wheres)->order('id')->select();
+            $list = Db::name('message')->where($wheres)->order('id')->paginate(1,'',$config);
             if($list){
                 foreach ($list as $k=>$v){
                     $data[$k]['message_id']=$v['id'];
                     $data[$k]['imgUrl']='';
-                    $data[$k]['time']=$v['sendtime'];
+                    $data[$k]['time']=date('Y-m-d  H:i A');
                     $data[$k]['title']=$v['template_name'];
                     $data[$k]['des']=$v['template_dsc'];
                     $data[$k]['push_type']=$v['type'];