Commit caded5d1 authored by 734642908@qq.com's avatar 734642908@qq.com

添加分页

parent c2f711b4
...@@ -10,10 +10,6 @@ class GameController extends BaseController ...@@ -10,10 +10,6 @@ class GameController extends BaseController
public function gameList() public function gameList()
{ {
// $gameUid = I('uid');//用户id
// $gameCode = I('game');//游戏编号
// $gameVersion = I('version');
$model= new \Home\Model\GameModel(); $model= new \Home\Model\GameModel();
//获取游戏列表数据 //获取游戏列表数据
$result = $model->getData(); $result = $model->getData();
......
...@@ -10,9 +10,13 @@ class GameModel extends BaseModel ...@@ -10,9 +10,13 @@ class GameModel extends BaseModel
$result = Array(); $result = Array();
$field = 'sysid,name,gamer,ad,appid,gourl'; //获取数量(分页)
$gameList = M("yl_game","",$this->__lewan_hezi)->where(array('status'=>1))->field($field)->select(); $size = I('size',10);
$page = I('page',1);
$skip = $size * ($page-1);
$field = 'sysid,name,gamer,ad,appid,gourl';
$gameList = M("yl_game","",$this->__lewan_hezi)->where(array('status'=>1))->field($field)->limit($skip,$size)->select();
$result = array( $result = array(
'c'=>1 'c'=>1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment