示例#1
0
 function sevenAction()
 {
     $p = empty($_GET['p']) ? 1 : $_GET['p'];
     $model = new sevenUserModel();
     $data = $model->setOrder('total desc,id asc')->getList(array(), 20, $p);
     $this->assign('list', $data['list']);
     $this->assign('page', $data['page']);
     $this->display();
 }
示例#2
0
 function getTop()
 {
     //统计
     $model = new sevenUserModel();
     $total = $model->select('openid', array('GROUP' => 'openid'));
     $data['total'] = count($total);
     //排名
     $sql = 'select openid,total,(@rowNum:=@rowNum+1) as pm from es_seven_user a,(Select (@rowNum :=0) ) b order by a.total desc,a.addtime DESC';
     $data['pm'] = 0;
     $rs = $model->query($sql)->fetchAll();
     foreach ($rs as $k => $v) {
         if ($v['openid'] == $_SESSION['openid']) {
             $data['pm'] = $v['pm'];
             break;
         }
     }
     $data['total'] += 300;
     $data['pm'] += 200;
     return $data;
 }