本文整理汇总了PHP中page::limit方法的典型用法代码示例。如果您正苦于以下问题:PHP page::limit方法的具体用法?PHP page::limit怎么用?PHP page::limit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类page
的用法示例。
在下文中一共展示了page::limit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: resumeList
/**
* 简历列表
*/
public function resumeList()
{
$db = V('resume');
$db->view = array('user_info' => array('type' => 'inner', 'on' => 'resume.uid=user_info.uid', 'field' => 'name'));
$cond = array();
if (isset($_GET['resume_name'])) {
$cond[] = 'resume_name like "%' . $_GET['resume_name'] . '%"';
}
if (isset($_GET['name'])) {
$cond[] = 'name like "%' . $_GET['name'] . '%"';
}
if (isset($_GET['created'])) {
$cond['created'] = array('gt' => strtotime($_GET['created']), 'lt' => time());
}
if (isset($_GET['updated'])) {
$cond['updated'] = array('gt' => strtotime($_GET['updated']), 'lt' => time());
}
if (isset($_GET['verify'])) {
$cond['verify'] = $_GET['verify'];
}
$nums = $db->where($cond)->count();
$page = new page($nums, 13);
$resumes = $db->where($cond)->findall($page->limit());
$this->assign('resumes', $resumes);
$this->assign('page', $page->show());
$this->display();
}
示例2: index
public function index(){
$total = $this->db->totalShop();
$page = new page($total,1);
$data = $this->db->getShop($page->limit());
$this->assign('page',$page->show());
$this->assign('data',$data);
$this->display();
}
示例3: word
/**
* 显示结果
*/
public function word($word)
{
$where = "uuid like '%" . intval($word) . "%'";
$count = $this->where($where)->count();
$page = new page($count, 10, 4, 2);
$union = $this->where($where)->select($page->limit());
return array("union" => $union, "count" => $count, "page" => $page->show());
}
示例4: check
public function check()
{
$db = M('wish');
$page = new page($db->count(), 5, 4, 2);
$this->assign('page', $page->show());
$wish = $db->select($page->limit());
foreach ($wish as $k => $v) {
$wish[$k]['content'] = $this->change_face($v['content']);
}
$this->assign('wish', $wish);
$this->display();
}
示例5: backup
function backup($table)
{
$tables = (include $this->path . '/backup_tables.php');
if (empty($tables)) {
//没有要备份的表
$this->error = "要备份的数据表为空!";
return FALSE;
}
if (!isset($tables[$table])) {
return TRUE;
//'操作完成'
}
$this->table = $tables[$table];
//需要操作的表
$this->db = M($this->table, TRUE);
$nums = $this->db->count() + 1;
$this->Copyright = "-- 该程序通过HDPHP框架构建\n-- Copyright :后盾网-张博\n-- version 2012.09\n-- http://www.houdunwang.com\n-- 主机: " . __WEB__ . "\n-- 备份日期: " . date('Y-m-d H:i:s') . "\n-- 服务器版本: " . $this->db->db->link->server_info . "\n-- PHP 版本: " . phpversion() . "\n\n";
$page = new page($nums, $this->limit);
$wfile = $_GET['file'];
//分卷文件标识
$file_plus = '';
$file_path = $this->path . '/sql_' . date('Ymd') . '_' . $wfile . '.sql';
$handle = fopen($file_path, 'ab');
if (filesize($file_path) > $this->filesize) {
$wfile += 1;
$file_plus = '/file/' . $wfile;
}
if ($table == 0 && $_GET['page'] == 1) {
//fwrite($handle, $this->Copyright);//写入版权信息
}
if ($_GET['page'] == 1) {
//写入建表语句
fwrite($handle, $this->getCreateTableSyntax());
}
$data = $this->db->findall($page->limit());
if ($_GET['page'] <= $page->total_page && $data) {
// fwrite($handle, $this->db->get_last_sql()."\n");//写入SQL查询语句
fwrite($handle, $this->getInsertSyntax($data));
//写入插入数据语句
go(url_remove_param('page') . '/page/' . ($_GET['page'] + 1) . $file_plus);
//fclose($handle);
} else {
//开始备份下一张表
$_GET['page'] = 1;
//将page还原为1
go(url_remove_param('table') . '/table/' . ($_GET['table'] + 1));
}
}
示例6: interview
function interview()
{
$db = M('interview');
$con = 'uid=' . $_SESSION['uid'];
$count = $db->where($con)->count();
$page = new page($count, 15);
$views = $db->where($con)->findall($page->limit());
$this->assign('views', $views);
$this->assign('page', $page->show());
$this->display('profile/interview');
}
示例7: feedback
public function feedback()
{
$type = array(1 => '建议', 2 => '咨询', 3 => '举报', 4 => '求助');
$this->assign('type', $type);
$db = M('feedback');
$nums = $db->count();
$page = new page($nums, 15);
$fbs = $db->order('process')->findall($page->limit());
$this->assign('fbs', $fbs);
$this->assign('type', $type);
$this->assign('page', $page->show());
$this->display();
}
示例8: resume
public function resume()
{
$auth = new auth();
if (!$auth->is_logged_in()) {
$this->error(L('please_login'), 'auth/index');
}
if (!$auth->check_uri_permissions()) {
$this->error($auth->error);
}
$db = M('model_field');
$filterCond = array();
//处理选项搜索字段
$switch_field = $db->field('title,field_name')->where('field_type="switch" and join_index=1 and dmid=6')->findall();
$model_struct = (include PATH_ROOT . '/caches/model/field/m_resume_basic.php');
foreach ($switch_field as $value) {
$filterCond['switchs'][$value['field_name']] = $model_struct[$value['field_name']]['data'];
}
//处理选项联动搜索字段
$linkage_filed = $db->field('title,field_name,lcgid')->where('field_type="linkage" and join_index=1 and dmid=6')->findall();
foreach ($linkage_filed as $value) {
$data = $db->table('linkage')->cache(86400)->field('laid,title')->where('lcgid=' . $value['lcgid'])->findall();
$filterCond['linkages'][$value['field_name']] = array('title' => $value['title'], 'data' => $data);
}
//处理选项地区搜索字段
$filterCond['address'] = $db->table('city')->cache(86400)->field('id,name,direct')->where('pid=0')->findall();
//地区
if (isset($_GET['address'])) {
$filterCond['sonAddress'] = $db->table('city')->cache(86400)->field('id,name')->where('pid=' . $_GET['address'])->findall();
//地区子类
}
$where = array('open' => 1, 'verify' => 1);
//resume表的条件:公开已验证
if (isset($_GET['address'])) {
//地址
$where[] = 'hope_provice=' . intval($_GET['address']);
}
if (isset($_GET['city'])) {
//地址
$where[] = 'hope_city=' . intval($_GET['city']);
}
if (isset($_GET['work_exp'])) {
//工作经验
$where[] = 'work_exp=' . intval($_GET['work_exp']);
}
if (isset($_GET['updated'])) {
//更新时间
$where['updated'] = 'updated >' . strtotime('-' . $_GET['updated'] . 'days');
}
$keywords = array();
if (!empty($_GET['keywords'])) {
//关键字
$_GET['keywords'] = strip_tags($_GET['keywords']);
$keywords = array_keys(string::split_word($_GET['keywords']));
$keyword_cond = '';
foreach ($keywords as $value) {
$keyword_cond .= 'resume_name LIKE "%' . $value . '%" OR ';
}
$keyword_cond = rtrim($keyword_cond, 'OR ');
$where[] = $keyword_cond;
}
$db = V('resume');
$db->view = array('resume_basic' => array('type' => 'INNER', 'on' => 'resume.resume_id=resume_basic.resume_id'));
$nums = $db->where($where)->count();
$page = new page($nums, 10);
$resumes = $db->where($where)->findall($page->limit());
if ($resumes) {
$data_class = new data('resume_basic');
foreach ($resumes as $key => $value) {
$resumes[$key] = $data_class->convert($value);
}
}
$this->assign('resumes', $resumes);
$this->assign('filterCond', $filterCond);
$this->assign('page', $page->show());
$this->display('search-resume');
}
示例9: viewFav
/**
* 查看收藏简历
*/
public function viewFav()
{
$db = M('favorite');
$nums = $db->where('type=2 AND company_id=' . $_SESSION['uid'])->count();
$page = new page($nums, 15);
$favorites = $db->where('type=2 AND company_id=' . $_SESSION['uid'])->order('created desc')->findall($page->limit());
$this->assign('favorites', $favorites);
$this->assign('page', $page->show());
$this->display('company/viewFav');
}
示例10: receiveDelivers
/**
* 企业收到的投递简历
*/
public function receiveDelivers($cond, $field = '', $order = 'sendtime desc')
{
$data = array();
$db = V('deliver');
$db->view = array('resume_basic' => array('type' => "INNER", 'on' => 'deliver.resume_id=resume_basic.resume_id', 'field' => 'name'));
$nums = $db->field($field)->where($cond)->count();
$page = new page($nums, 13);
$data['deliver'] = $db->field($field)->where($cond)->order($order)->findall($page->limit());
$data['page'] = $page->show();
return $data;
}
示例11: hotKeyword
public function hotKeyword()
{
$db = M('keywords');
$nums = $db->count();
$page = new page($nums, 12);
$keywords = $db->order('nums desc')->findall($page->limit());
$this->assign('keywords', $keywords);
$this->assign('page', $page->show());
$this->display();
}
示例12: getLinkageData
/**
* 取得联动数据,一级一级显示
*/
function getLinkageData($condition)
{
$data = array();
$nums = $this->linkage_model->where($condition)->count();
$page = new page($nums, 10, 6);
//传入总记录数,用于计算出分页
$data['page'] = $page->show();
//显示分页页码
$cache_name = 'linkage_' . $condition['lcgid'] . '_' . $condition['pid'];
//配置缓存名称
$cache_dir = $this->cache_dir . 'linkage';
$data['data'] = $this->linkage_model->where($condition)->order('sort')->findall($page->limit());
return $data;
}
示例13: recruitList
/**
* 招聘列表
*/
public function recruitList()
{
$db = M('recruit');
//组合条件
$cond = array();
if (isset($_GET['recruit_name'])) {
$cond[] = 'recruit_name like "%' . $_GET['recruit_name'] . '%"';
}
if (isset($_GET['company_name'])) {
$cond[] = 'company_name like "%' . $_GET['company_name'] . '%"';
}
if (isset($_GET['created'])) {
$cond['created'] = array('gt' => strtotime($_GET['created']), 'lt' => time());
}
if (isset($_GET['refresh_date'])) {
$cond['refresh_date'] = array('gt' => strtotime($_GET['refresh_date']), 'lt' => time());
}
if (isset($_GET['state'])) {
if ($_GET['state'] == 2) {
//已过期
$cond[] = 'expiration_time <' . time();
} else {
$cond['state'] = $_GET['state'];
}
}
if (isset($_GET['verify'])) {
$cond['verify'] = $_GET['verify'];
}
//组合条件
$field = 'recruit_id,recruit_name,created,refresh_date,company_name,state,verify,expiration_time,views';
$nums = $db->where($cond)->count();
$page = new page($nums, 15);
$recruits = $db->field($field)->where($cond)->order('created desc')->findall($page->limit());
$this->assign('recruits', $recruits);
$this->assign('page', $page->show());
$this->display();
}
示例14: userList
function userList($cond = array())
{
if (!empty($cond['group'])) {
//如果有用户组条件
$db = V('user');
$db->view = array('user_role' => array('type' => 'inner', 'on' => 'user.uid =user_role.uid'), 'role' => array('type' => 'inner', 'on' => 'user_role.rid=role.rid'));
$nums = $db->where($cond['user'], $cond['group'])->count();
$page = new page($nums, 12);
$users = array();
$users['user'] = $db->where($cond['user'], $cond['group'])->findall();
$users['page'] = $page->show();
} else {
$nums = $this->user_r_model->where($cond['user'])->count();
$page = new page($nums, 12);
$users = array();
$users['user'] = $this->user_r_model->where($cond['user'])->order('created desc')->findall($page->limit());
$users['page'] = $page->show();
}
return $users;
}
示例15: optLog
/**
* 企业操作日志
*/
public function optLog($cond)
{
$db = M('opt_log');
$nums = $db->where($cond)->count();
$page = new page($nums, 15);
$logs = array();
$logs['log'] = $db->where($cond)->order('created desc')->findall($page->limit());
$logs['page'] = $page->show();
return $logs;
}