Selaa lähdekoodia

Merge branch 'talksec' of 121.43.114.153:/home/git/repositories/shopnc into talksec

stanley-king 6 vuotta sitten
vanhempi
commit
f9185245e0
2 muutettua tiedostoa jossa 13 lisäystä ja 4 poistoa
  1. 10 2
      helper/room_helper.php
  2. 3 2
      mobile/control/member_bonus.php

+ 10 - 2
helper/room_helper.php

@@ -148,16 +148,24 @@ class room_helper
         return $result;
     }
 
-    public static function other_rooms($cond, $order = 'room_id desc', $limit = 5 , $page = false)
+    public static function other_rooms($cond, $order = 'room_id desc', $limit = 5 , $page = false,&$mobile_page)
     {
         $result = [];
         $mod_room = Model('room');
         $items = $mod_room->getRooms($cond,'*',$order,$limit,$page);
-        foreach ($items as $item) {
+        foreach ($items as $idx => $item) {
             $room = new room\room_info($item);
             $info = $room->format();
+            $page = intval($_GET['curpage']) > 0 ? intval($_GET['curpage']) : 1;
+            $pos  = ($page - 1) * $limit + $idx + 1;
+            $info['rank'] = $pos;
             $result[] = $info;
         }
+        if($page){
+             $mobile_page = mobile_page($mod_room->gettotalpage());;
+        }else{
+             $mobile_page = [];
+        }
         return $result;
     }
 

+ 3 - 2
mobile/control/member_bonus.php

@@ -50,7 +50,7 @@ class member_bonusControl extends mbMemberControl
             $result['mine_room'] = $mine_rooms;
         }
 
-        $result['other_room'] = room_helper::other_rooms(['type' => proto_type::room_chat]);
+        $result['other_room'] = room_helper::other_rooms(['type' => proto_type::room_chat],'steps_count desc,room_id desc');
         return self::outsuccess($result);
     }
     public function mine_bonusOp()
@@ -61,7 +61,8 @@ class member_bonusControl extends mbMemberControl
     }
 
     public function other_roomsOp (){
-        $result['other_room'] = room_helper::other_rooms(['type' => proto_type::room_chat],'room_id desc',20, 20);
+        $result['other_room'] = room_helper::other_rooms(['type' => proto_type::room_chat],'steps_count desc,room_id desc',20, 20,$mobile_page);
+        $result['mobile_page'] = $mobile_page;
         return self::outsuccess($result);
     }