stanley-king 8 years ago
parent
commit
c766744e1c

+ 3 - 3
helper/model/ranklist.php

@@ -107,7 +107,7 @@ class ranklist
             $this->dirty = true;
             $this->top_id = $top_id;
         }
-        if(intval($this->top_money * 100 + 0.5) == intval($top_money * 100 + 0.5)) {
+        if(intval($this->top_money * 100 + 0.5) != intval($top_money * 100 + 0.5)) {
             $this->dirty = true;
             $this->top_money = $top_money;
         }
@@ -156,7 +156,7 @@ class ranklist
     }
     public function supports()
     {
-        return $this->supports();
+        return $this->supports;
     }
 
     public function support()
@@ -184,7 +184,7 @@ class ranklist
             $this->top_id = intval($param['top_id']);
             $this->top_money = $param['top_money'];
             $this->supports = intval($param['supports']);
-            $this->friends = empty($param['$friends']) ? array() : unserialize(($param['$friends']));
+            $this->friends = empty($param['friends']) ? array() : unserialize(($param['friends']));
 
             $this->update = true;
         } else {

+ 5 - 4
helper/ranklist_helper.php

@@ -110,7 +110,7 @@ class ranklist_helper
         }
     }
 
-    public static function gen_ranklist($list_sn,&$err)
+    public static function gen_ranklist($list_sn,&$userid,&$err)
     {
         $rank = ranklist::create_by_sn($list_sn);
         if($rank == false) {
@@ -118,9 +118,10 @@ class ranklist_helper
             return false;
         }
         $friends = $rank->get_friends();
+        $userid = $rank->member_id();
         $mod_rank = Model('bonus_ranklist');
         $cond = array('list_date' => $rank->list_date(),'member_id' => array('in',$friends));
-        $items = $mod_rank->getRanklist($cond,'*','order by list_value desc');
+        $items = $mod_rank->getRanklist($cond,'*','list_value desc');
         if(!empty($items)) {
             $top = ranklist::create_by_store($items[0]);
             $rank->set_top($top->member_id(),$top->money());
@@ -153,7 +154,7 @@ class ranklist_helper
         }
 
         $mod_top = Model('bonus_ranklist');
-        $items = $mod_top->getRanklist(array('member_id' => array('in',$friends),'list_date' => $list_date),'*','order by list_value desc');
+        $items = $mod_top->getRanklist(array('member_id' => array('in',$friends),'list_date' => $list_date),'*','list_value desc');
 
         if(empty($items)) {
             $top->set_top($member_id,$top->money());
@@ -193,7 +194,7 @@ class ranklist_helper
         }
 
         $mod_top = Model('bonus_ranklist');
-        $items = $mod_top->getRanklist(array('member_id' => $member_id,'list_date' => array('in',$times)),'*','order by list_date desc');
+        $items = $mod_top->getRanklist(array('member_id' => $member_id,'list_date' => array('in',$times)),'*','list_date desc');
         foreach ($items as $item)
         {
             $top = ranklist::create_by_store($item);

+ 3 - 3
mobile/control/rank_list.php

@@ -20,7 +20,7 @@ class rank_listControl extends mobileControl
             return self::outerr(errcode::ErrParamter,'请输入排行榜序列号.');
         }
 
-        $items = ranklist_helper::gen_ranklist($list_sn,$err);
+        $items = ranklist_helper::gen_ranklist($list_sn,$userid,$err);
         if($items == false) {
             return self::outerr($err['code'],$err['msg']);
         }
@@ -41,7 +41,7 @@ class rank_listControl extends mobileControl
             $item['rank'] = $rank_num;
             array_push($list_infos,$item);
             array_push($mids,$rank->member_id());
-            if($_SESSION['member_id'] == $rank->member_id()) {
+            if($userid == $rank->member_id()) {
                 $mine = $item;
             }
             ++$rank_num;
@@ -86,7 +86,7 @@ class rank_listControl extends mobileControl
             $_SESSION['rank_list'] = array();
         }
 
-        if(array_key_exists($list_sn,$_SESSION['rank_list'])) {
+        if(array_key_exists($list_sn,$_SESSION['rank_list']) == false) {
             $_SESSION['rank_list'][$list_sn] = array();
             $_SESSION['rank_list'][$list_sn]['supported'] = false;
         }

+ 8 - 6
mobile/templates/default/bonus/ranklist.php

@@ -89,7 +89,7 @@
             width: 20%;
         }
         .concern_box {
-            background: url("<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/images/noconcern.png") no-repeat center 85%;
+            background: url("<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/imgaes/noconcern.png") no-repeat center 85%;
             background-size: 0.96rem 0.81rem;
             font-size: 1rem;
             height: 58px;
@@ -97,7 +97,7 @@
             bottom: 8px;
         }
         .concern_box_active {
-            background: url("<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/images/concern.png") no-repeat center 85%;
+            background: url("<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/imgaes/concern.png") no-repeat center 85%;
             background-size: 0.96rem 0.81rem;
         }
         .margin-r-1 {
@@ -130,13 +130,15 @@
 </div>
 <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/js/zepto.min.js"></script>
 <script type="text/javascript">
-    $(function(){
+    $(function()
+    {
         var concern={
             number:function(id){
                 var that=this;
                 $(id).on('touchstart',function(){
                     var number=parseInt($(this).text()),
                         datas=$(this).find('.list_sn').val();
+                    alert(number + "   " + datas);
                     if($(this).hasClass('concern_box_active')){
                         $(this).removeClass('concern_box_active');
                         var num=number-1;
@@ -152,20 +154,20 @@
                 })
             },
             ajax:function(data){
-                var that=this;
                 $.ajax({
-                    url:'http://a.lrlz.com/mobile/index.php?act=rank_list&op=support&client_type=wap',
+                    url:'http://localhost/mobile/index.php?act=rank_list&op=support&client_type=wap',
                     dataType:'jsonp',
                     jsonp:'callback',
                     data:{
                         list_sn:data
                     },
                     success:function(){
-                        return false;
+                        return true;
                     }
                 })
             }
         };
+        $('.number').eq(1).addClass('first');
         concern.number('.concern_box');
     })
 </script>