public function index() { if (IS_POST) { parent::page(array('size' => PUT('size', 10), 'page' => PUT('p'), 'orderby' => 'id desc')); } else { $this->display(); } }
/** * 数据列表 */ public function lists() { if (IS_POST) { $title = PUT('title'); $map = array(); // $map['title'] = array('like',"%$title%"); parent::page(array('size' => PUT('size', 10), 'page' => PUT('p'), 'where' => $map, 'orderby' => 'id asc')); } else { $this->display(); } }
/** * 数据列表 */ public function lists() { if (IS_POST) { $title = PUT('title'); $map = array(); $map['type'] = 1; $map['title'] = array('like', "%{$title}%"); parent::page(array('after_select' => 'after_select', 'size' => PUT('size', 10), 'page' => PUT('p'), 'where' => $map, 'orderby' => 'sort desc,id desc')); } else { $this->display(); } }
/** * 数据列表 */ public function lists() { if (IS_POST) { $username = PUT('username'); $role_id = PUT('role_id'); $map = array(); $map['username'] = array('like', "%{$username}%"); if ($role_id) { $map['role_id'] = $role_id; } parent::page(array('size' => PUT('size', 10), 'page' => PUT('p'), 'rel' => true, 'where' => $map, 'orderby' => 'id')); } else { $this->display(); } }