qifengquan 1 year ago
parent
commit
fe3bcd221f
2 changed files with 5 additions and 1 deletions
  1. 1 1
      application/api/controller/Information.php
  2. 4 0
      application/api/controller/User.php

+ 1 - 1
application/api/controller/Information.php

@@ -71,7 +71,7 @@ class Information extends Api
      */
     public function weApply(){
         $uid = $this->auth->id;
-        $data = Apply::all(['uid'=>$uid],['Nuser']);
+        $data = Apply::where(['uid'=>$uid])->with('Nuser')->order('id','desc')->select();
         Apply::u_read($data);
         $this->success('',$data);
     }

+ 4 - 0
application/api/controller/User.php

@@ -120,11 +120,13 @@ class User extends Api
         if($type==1){
             $ilike = Like::where(['uid'=>$uid,'type'=>1])
                 ->with('Nuser')
+                ->order('id','desc')
                 ->select();
             $res = $ilike;
         }elseif($type==2){
             $ilike = Like::where(['nid'=>$uid,'type'=>1])
                 ->with('Uuser')
+                ->order('id','desc')
                 ->select();
             foreach ($ilike as $k=>$v){
                 Like::get(['uid'=>$uid,'nid'=>$v['uid']])??$ilike[$k]['like']=1;
@@ -135,12 +137,14 @@ class User extends Api
         }elseif($type==3){
             $ilike = Apply::where(['nid'=>$uid])
                 ->with('uidinfo')
+                ->order('id','desc')
                 ->select();
             $res = $ilike;
             Apply::n_read($ilike);
         }elseif($type==4){
             $ilike = Like::where(['nid'=>$uid,'type'=>2])
                 ->with('Uuser')
+                ->order('id','desc')
                 ->select();
             foreach ($ilike as $k=>$v){
                 Unlockprogress::get(['uid'=>$v['nid'],'nid'=>$v['uid']])?$ilike[$k]['Unlockprogress']=1:$ilike[$k]['Unlockprogress']=null;