public function caseList() { if ($this->isLogin()) { import('ORG.Util.Page'); //导入分页类 $Page = new Page($count, 5); if (!$this->isPost()) { $count = $this->model->where()->count(); $show = $Page->show(); $data = $this->model->where()->order('createtime desc')->limit($Page->firstRow . ',' . $Page->listRows)->select(); $this->assign('page', $show); $this->assign('data', $data); $this->display(); } else { $decoration = getRequest("decoration"); $style = getRequest("style"); $where = array('decoration_style' => $decoration, 'style' => $style); if (!$where) { $this->error('请填写查询条件'); } else { $count = $this->model->where($where)->count(); $show = $Page->show(); $data = $this->model->where($where)->order('createtime desc')->limit($Page->firstRow . ',' . $Page->listRows)->select(); if ($data) { $this->assign('page', $show); $this->assign('data', $data); $this->display(); } else { $this->error('没有查到符合内容!', $_SERVER['HTTP_REFERER']); } } } } }
function index() { $classify = $this->_get('classify'); //$classid = $this->_get('classid'); //if($classify){ $db = D('Img'); $where['classname'] = $classify; $where['classid'] = $classid; $_SESSION['classname'] = $classify; $_SESSION['classid'] = $classid; $count = $db->where($where)->count(); $page = new Page($count, 25); $info = $db->where($where)->order('statdate DESC,id DESC')->limit($page->firstRow . ',' . $page->listRows)->select(); $this->assign('page', $page->show()); $this->assign('info', $info); $info2 = M('Function')->where(array('name' => $classify))->find(); $this->assign('classify', $info2['funtype']); $this->assign('classify2', $classify); $this->assign('token', session('token')); $this->display('Img:index'); //} //else{ // $this->error('没有找到该分类!'); //} }
public function index() { if ($this->open_sign == 0) { //未开启活动提示 } $set_id = M('sign_set')->where(array('token' => session('token')))->getField('id'); // $where = array('set_id'=>$set_id); $where = array(); $user_name = $this->_post('user_name', 'htmlspecialchars,trim'); $sort = $this->_post('sort', 'trim'); $startdate = strtotime($this->_post('startdate', 'trim')); $enddate = strtotime($this->_post('enddate', 'trim')); if ($startdate && $enddate) { $where['time'] = array(array('gt', $startdate), array('lt', $enddate), 'and'); } if ($user_name) { $where['user_name'] = array('like', '%' . $user_name . '%'); } if (empty($sort)) { $order = 'time desc'; } else { $order = 'time ' . $sort; } $count = $this->sign_db->where($where)->count(); $Page = new Page($count, 12); $list = $this->sign_db->where($where)->order($order)->limit($Page->firstRow . ',' . $Page->listRows)->select(); $this->assign('search', array('startdate' => $startdate, 'enddate' => $enddate, 'sort' => $sort)); $this->assign('page', $Page->show()); $this->assign('list', $list); $this->assign('listinfo', 1); $this->display(); }
private function cate() { require APP_ROOT_PATH . 'app/Lib/page.php'; $cate_id = 6; $GLOBALS['tmpl']->caching = true; $cache_id = md5(MODULE_NAME . ACTION_NAME . "cate" . $cate_id . intval($_REQUEST['p'])); if (!$GLOBALS['tmpl']->is_cached('page/usagetip_index.html', $cache_id)) { $cate_item = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "article_cate where id = {$cate_id} and is_effect = 1 and is_delete = 0"); if ($cate_id > 0 && !$cate_item) { app_redirect(APP_ROOT . "/"); } $cate_tree = get_acate_tree(); $GLOBALS['tmpl']->assign("acate_tree", $cate_tree); //分页 $page = intval($_REQUEST['p']); if ($page == 0) { $page = 1; } $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE"); $result = get_article_list($limit, $cate_id, '', ''); $GLOBALS['tmpl']->assign("list", $result['list']); $page = new Page($result['count'], app_conf("PAGE_SIZE")); //初始化分页对象 $p = $page->show(); $GLOBALS['tmpl']->assign('pages', $p); //使用技巧 $use_tech_list = get_article_list(6, 6); $GLOBALS['tmpl']->assign("use_tech_list", $use_tech_list); $GLOBALS['tmpl']->assign("page_title", $cate_item['title']); $GLOBALS['tmpl']->assign("page_keyword", $cate_item['title'] . ","); $GLOBALS['tmpl']->assign("page_description", $cate_item['title'] . ","); } $GLOBALS['tmpl']->display("page/usagetip_index.html", $cache_id); }
public function index() { if (!$GLOBALS['user_info']) { app_redirect(url("user#login")); } $all = intval($_REQUEST['all']); $page_size = 20; $page = intval($_REQUEST['p']); if ($page == 0) { $page = 1; } $limit = ($page - 1) * $page_size . "," . $page_size; if ($all == 0) { $cond = " and is_read = 0 "; } else { $cond = " and 1=1 "; } $GLOBALS['tmpl']->assign("all", $all); $sql = "select * from " . DB_PREFIX . "user_notify where user_id = " . intval($GLOBALS['user_info']['id']) . " {$cond} order by log_time desc limit " . $limit; $sql_count = "select count(*) from " . DB_PREFIX . "user_notify where user_id = " . intval($GLOBALS['user_info']['id']) . " {$cond} "; $notify_list = $GLOBALS['db']->getAll($sql); $notify_count = $GLOBALS['db']->getOne($sql_count); foreach ($notify_list as $k => $v) { $notify_list[$k]['url'] = parse_url_tag("u:" . $v['url_route'] . "|" . $v['url_param']); } $GLOBALS['tmpl']->assign("notify_list", $notify_list); require APP_ROOT_PATH . 'app/Lib/page.php'; $page = new Page($notify_count, $page_size); //初始化分页对象 $p = $page->show(); $GLOBALS['tmpl']->assign('pages', $p); $GLOBALS['tmpl']->display("notify.html"); }
public function index() { if (IS_POST) { $this->all_insert('Recognition'); } else { $db = D('Recognition'); $where = array('token' => session('token')); $count = $db->where($where)->count(); $page = new Page($count, 25); $wechat_group_db = M('Wechat_group'); $list = $db->where($where)->limit($page->firstRow . ',' . $page->listRows)->order('id desc')->select(); foreach ($list as $key => $value) { $list[$key]['group'] = $wechat_group_db->where(array('token' => $this->token, 'wechatgroupid' => $value['groupid']))->getField('name'); } $groups = $wechat_group_db->where(array('token' => $this->token))->order('id ASC')->select(); $this->assign('groups', $groups); $this->assign('page', $page->show()); $this->assign('list', $list); if (ALI_FUWU_GROUP) { $fuwu = 'yes'; } else { $fuwu = 'no'; } $this->assign('fuwu', $fuwu); $this->display(); } }
public function index() { parent::userauth2(60); $sid = I('get.sid', ''); $menu = D('Dmenu'); import('ORG.Util.Page'); // 导入分页类 if ($sid != '') { $where['Sid'] = $sid; } else { $where['Sid'] = 0; } $count = $menu->where($where)->count(); //总记录数 $Page = new Page($count, 15); //实例化分页类 传入总记录数和每页显示的记录数 $Page->setConfig('header', '条记录'); $Page->setConfig('prev', '<img src="__IMAGE__/prev.gif" border="0" title="上一页" />'); $Page->setConfig('next', '<img src="__IMAGE__/next.gif" border="0" title="下一页" />'); $Page->setConfig('first', '<img src="__IMAGE__/first.gif" border="0" title="第一页" />'); $Page->setConfig('last', '<img src="__IMAGE__/last.gif" border="0" title="最后一页" />'); $show = $Page->show(); //分页显示输出 $volist = $menu->relation(true)->where($where)->order('Sortid asc')->limit($Page->firstRow . ',' . $Page->listRows)->select(); $list = $menu->where('Sid = 0')->order('Sortid asc')->select(); $this->assign('volist', $volist); $this->assign('list', $list); $this->assign('sid', $sid); $this->assign('page', $show); //输出分页 $this->co = $count; $this->display('System/dmenu'); }
public function index() { global $tmpl; $rel_table = addslashes(trim($_REQUEST['act'])); $message_type = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "message_type where type_name='" . $rel_table . "' and type_name <> 'supplier'"); if (!$message_type || $message_type['is_fix'] == 0) { app_redirect(APP_ROOT . "/"); } $rel_table = $message_type['type_name']; $condition = ''; $id = intval($_REQUEST['id']); if ($rel_table == 'deal') { $deal = get_deal($id); if ($deal['buy_type'] != 1) { $GLOBALS['tmpl']->assign("deal", $deal); } $id = $deal['id']; } require APP_ROOT_PATH . 'app/Lib/side.php'; if ($id > 0) { $condition = "rel_table = '" . $rel_table . "' and rel_id = " . $id; } else { $condition = "rel_table = '" . $rel_table . "'"; } if (app_conf("USER_MESSAGE_AUTO_EFFECT") == 0) { $condition .= " and user_id = " . intval($GLOBALS['user_info']['id']); } else { if ($message_type['is_effect'] == 0) { $condition .= " and user_id = " . intval($GLOBALS['user_info']['id']); } } $condition .= " and is_buy = " . intval($_REQUEST['is_buy']); //message_form 变量输出 $GLOBALS['tmpl']->assign("post_title", $message_type['show_name']); $GLOBALS['tmpl']->assign("page_title", $message_type['show_name']); $GLOBALS['tmpl']->assign('rel_id', $id); $GLOBALS['tmpl']->assign('rel_table', $rel_table); $GLOBALS['tmpl']->assign('is_buy', intval($_REQUEST['is_buy'])); if (intval($_REQUEST['is_buy']) == 1) { $GLOBALS['tmpl']->assign("post_title", $GLOBALS['lang']['AFTER_BUY']); $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['AFTER_BUY']); } if (!$GLOBALS['user_info']) { $GLOBALS['tmpl']->assign("message_login_tip", sprintf($GLOBALS['lang']['MESSAGE_LOGIN_TIP'], url("shop", "user#login"), url("shop", "user#register"))); } //分页 $page = intval($_REQUEST['p']); if ($page == 0) { $page = 1; } $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE"); $message = get_message_list($limit, $condition); $page = new Page($message['count'], app_conf("PAGE_SIZE")); //初始化分页对象 $p = $page->show(); $GLOBALS['tmpl']->assign('pages', $p); $GLOBALS['tmpl']->assign("message_list", $message['list']); $GLOBALS['tmpl']->assign("user_auth", get_user_auth()); $GLOBALS['tmpl']->display("message.html"); }
public function index() { $form_id = intval(I('get.form_id')); $map = array('id' => $form_id, 'is_del' => 0); $form_one = D('form')->where($map)->find(); if (!$form_one) { $this->error('未找到表单,请返回重试!'); } $list = array(); $map = array('form_id' => $form_id, 'is_del' => 0); $count = D('foreign_test')->where($map)->count('id'); if ($count > 0) { import("@.Org.Util.Page"); $p = new \Page($count, 5); //分页跳转的时候保证查询条件 foreach ($_GET as $key => $val) { if (!is_array($val)) { $p->parameter .= $key . '=' . urlencode($val) . '&'; } } //分页显示 $page = $p->show(); $list = D('foreign_test')->field('id,name,updatetime,dateline')->where($map)->order('id desc')->limit($p->firstRow . ',' . $p->listRows)->select(); } $this->assign('form_one', $form_one); $this->assign('page', $page); $this->assign('list', $list); $this->display(); }
function index2() { $items_mod = M('items'); $items_comments_mod = M('items_comments'); import("ORG.Util.Page"); $prex = C('DB_PREFIX'); //搜索 $where = '1=1'; if (isset($_GET['keyword']) && trim($_GET['keyword'])) { $where .= " AND (" . $prex . "info.name LIKE '%" . $_GET['keyword'] . "%' or title LIKE '%" . $_GET['keyword'] . "%')"; $this->assign('keyword', $_GET['keyword']); } $count = $mod->where($where)->count(); $p = new Page($count, 20); $list = $mod->where($where)->field($prex . 'user_comments.*,' . $prex . 'items.title as title')->join('LEFT JOIN ' . $prex . 'items ON ' . $prex . 'user_comments.items_id = ' . $prex . 'items.id ')->limit($p->firstRow . ',' . $p->listRows)->order($prex . 'user_comments.add_time DESC')->select(); echo $mod->getlastSQL(); exit; $key = 1; foreach ($list as $k => $val) { $list[$k]['key'] = ++$p->firstRow; } $big_menu = array('javascript:window.top.art.dialog({id:\'add\',iframe:\'?m=items_comments&a=add\', title:\'' . L('add_flink') . '\', width:\'450\', height:\'250\', lock:true}, function(){var d = window.top.art.dialog({id:\'add\'}).data.iframe;var form = d.document.getElementById(\'dosubmit\');form.click();return false;}, function(){window.top.art.dialog({id:\'add\'}).close()});void(0);', L('add_flink')); $page = $p->show(); $this->assign('page', $page); $this->assign('big_menu', $big_menu); $this->assign('list', $list); $this->display(); }
function notice_management($flag = null) { $a = M('notice'); import('ORG.Util.Date'); // 导入日期类 import('ORG.Util.Page'); // 导入分页类 $count = $a->where($where)->count(); //获取数据的总数 $page = new Page($count, 15); // $page->setConfig('header', '条信息'); $show = $page->show(); //返回分页信息 $arr = $a->where($where)->order('istop desc,createtime desc')->limit($page->firstRow . ',' . $page->listRows)->select(); for ($i = 0; $i < sizeof($arr); $i++) { $arr[$i]['createtime'] = $arr[$i]['createtime']; $Date = new Date($arr[$i]['createtime']); $time = $Date->dateDiff(time(), 'd'); // 比较日期差 $arr[$i]['lefttop'] = round($arr[$i]['topday'] - $time); } $this->assign('show', $show); $this->assign("notice", $arr); if (!$flag) { $this->display(); } }
public function index() { $user_id = $GLOBALS['user_info']['id']; $page = intval($_REQUEST['p']); if ($page == 0) { $page = 1; } $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE"); $status = $_REQUEST['status']; if (!$status) { $condition = ""; } elseif ($status == 3) { $condition = " and status = 0"; //未审核 } elseif ($status == 1) { $condition = " and status = 1"; //已通过 } elseif ($status == 2) { $condition = " and status = 2"; //未通过 } $GLOBALS['tmpl']->assign('status', $status); $result = get_deal_quota_list($limit, $user_id, $condition); $GLOBALS['tmpl']->assign("list", $result['list']); $page = new Page($result['count'], app_conf("PAGE_SIZE")); //初始化分页对象 $p = $page->show(); $GLOBALS['tmpl']->assign('pages', $p); $GLOBALS['tmpl']->assign("page_title", "授信额度申请"); $GLOBALS['tmpl']->assign("inc_file", "inc/uc/uc_deal_quota.html"); $GLOBALS['tmpl']->display("page/uc.html"); }
public function get_user($url, $name = '', $schoolName = '') { $page = new Page(); $listRows = 1; //产品每页显示的信息条数 $field = 'name, addr, phone, s_name, point'; // $url=__URL__.'?p={page}';//分页基准网址 $cur_page = $page->getCurPage($url); $limit_start = ($cur_page - 1) * $listRows; $limit = $limit_start . ',' . $listRows; $con = ''; if (!empty($schoolName)) { $con = 's_id=\'' . $schoolName . '\''; } if (!empty($name)) { if (empty($con)) { $con = 'name like \'%' . $name . '%\''; } else { $con .= ' and name like \'%' . $name . '%\''; } } if (empty($con)) { $count = $this->model->table($this->config['info_person'])->count(); $sql = $this->model->table($this->config['info_person'])->field($field)->limit($limit)->select(); } else { $count = $this->model->table($this->config['info_person'])->where($con)->count(); $sql = $this->model->table($this->config['info_person'])->field($field)->where($con)->limit($limit)->select(); } return array('data' => $sql, 'page' => $page->show($url, $count, $listRows)); }
public function searchuser() { $searchcondition = I('searchcondition', ''); $searchcontent = I('searchcontent', ''); if ($searchcondition == 'sclass') { switch ($searchcontent) { case '店铺': $searchcontent = 1; break; case '管理': $searchcontent = 2; break; case '供应商': $searchcontent = 3; break; } } if (!empty($searchcondition) && !empty($searchcontent)) { import('ORG.Util.Page'); $condition[$searchcondition] = array('like', '%' . $searchcontent . '%'); $count = M('shop')->where($condition)->count(); $page = new Page($count, 10); $limit = $page->firstRow . ',' . $page->listRows; $shop = M('shop')->where($condition)->order('sclass')->limit($limit)->select(); $this->page = $page->show(); $this->shop = $shop; $this->display('index'); } }
function sp_sql_qiushis_paged($tag = "", $pagesize = 20, $pagetpl = '{first}{prev}{liststart}{list}{listend}{next}{last}') { $tag = sp_param_lable($tag); $field = !empty($tag['field']) ? $tag['field'] : 'b.*'; $limit = !empty($tag['limit']) ? $tag['limit'] : ''; $order = !empty($tag['order']) ? $tag['order'] : 'createtime desc'; $field = "a.cat_name,c.user_login,c.user_nicename," . $field; $qiushi_cat_model = M("QiushiCat"); $join = C('DB_PREFIX') . 'qiushi as b on a.id =b.cid'; $join2 = C('DB_PREFIX') . 'users as c on c.id =b.uid'; $where = array("b.status" => 1, "a.status" => 1); if (isset($tag['cid'])) { $where['cid'] = array('in', $tag['cid']); } $totalsize = $qiushi_cat_model->alias("a")->join($join)->where($where)->count(); import('Page'); $PageParam = C("VAR_PAGE"); $page = new \Page($totalsize, $pagesize); $page->setLinkWraper("li"); $page->__set("PageParam", $PageParam); $pagetpl = '{first}{prev}{liststart}{list}{listend}{next}{last}'; $page->SetPager('default', $pagetpl, array("listlong" => "6", "first" => "首页", "last" => "尾页", "prev" => "上一页", "next" => "下一页", "list" => "*", "disabledclass" => "")); $qiushis = $qiushi_cat_model->field($field)->alias("a")->join($join)->join($join2)->where($where)->order($order)->limit($page->firstRow . ',' . $page->listRows)->select(); $return['count'] = $totalsize; $return['items'] = $qiushis; $return['page'] = $page->show('default'); return $return; }
function index() { $group_id = isset($_GET['group_id']) && intval($_GET['group_id']) ? intval($_GET['group_id']) : ''; $keyword = isset($_GET['keyword']) && trim($_GET['keyword']) ? trim($_GET['keyword']) : ''; $where = '1=1'; if ($group_id != '') { $where .= " AND group_id={$group_id}"; } if ($keyword != '') { $where .= " AND module like '%{$keyword}%' or module_name like '%{$keyword}%' or action_name like '%{$keyword}%'"; } $node_mod = D('node'); import("ORG.Util.Page"); $count = $node_mod->where($where)->count(); $p = new Page($count, 15); $node_list = $node_mod->where($where)->limit($p->firstRow . ',' . $p->listRows)->order('module asc,sort ASC')->select(); $big_menu = array('javascript:window.top.art.dialog({id:\'add\',iframe:\'?m=Node&a=add\', title:\'添加菜单\', width:\'500\', height:\'490\', lock:true}, function(){var d = window.top.art.dialog({id:\'add\'}).data.iframe;var form = d.document.getElementById(\'dosubmit\');form.click();return false;}, function(){window.top.art.dialog({id:\'add\'}).close()});void(0);', '添加菜单'); $page = $p->show(); $group_mod = D('group'); $group_list = $group_mod->select(); $this->assign('group_list', $group_list); $this->assign('group_id', $group_id); $this->assign('keyword', $keyword); $this->assign('page', $page); $this->assign('big_menu', $big_menu); $this->assign('node_list', $node_list); $this->display(); }
public function publist() { $Pub = D('pub'); if (isset($_GET['pid'])) { $_GET['pid'] = intval($_GET['pid']); $Pub->where('id=' . $_GET['pid'])->delete(); header('Location: ' . __ADMIN__ . '/Pub/publist'); } import('ORG.Util.Page'); // 导入分页类 $count = $Pub->count(); // 查询满足要求的总记录数 $Page = new Page($count, 25); // 实例化分页类 传入总记录数和每页显示的记录数 $show = $Page->show(); // 分页显示输出 // 进行分页数据查询 注意limit方法的参数要使用Page类的属性 $list = $Pub->order('pubtime desc')->limit($Page->firstRow . ',' . $Page->listRows)->select(); $this->assign('list', $list); // 赋值数据集 $this->assign('page', $show); // 赋值分页输出 $this->display(); // 输出模板 }
public function sn() { $lid = $this->_get('id', 'intval'); $id = M('Lottery')->where(array('zjpic' => $lid, 'token' => $this->token))->getField('id'); $type = $this->_get('type', 'intval'); $lottery = M('Activity')->where(array('token' => $this->token, 'id' => $lid, 'type' => $type))->find(); $this->assign('Activity', $lottery); $recordcount = $lottery['fistlucknums'] + $lottery['secondlucknums'] + $lottery['thirdlucknums'] + $lottery['fourlucknums'] + $lottery['fivelucknums'] + $lottery['sixlucknums']; $datacount = $lottery['fistnums'] + $lottery['secondnums'] + $lottery['thirdnums'] + $lottery['fournums'] + $lottery['fivenums'] + $lottery['sixnums']; $this->assign('datacount', $datacount); $this->assign('recordcount', $recordcount); $box = M('Autumns_box'); $lcount = $box->where(array('token' => $this->token, 'bid' => $id, 'isprize' => 1))->count(); $page = new Page($lcount, 20); $this->assign('page', $page->show()); $list = $box->where(array('token' => $this->token, 'bid' => $id, 'isprize' => 1))->order('id desc')->limit($page->firstRow . ',' . $page->listRows)->select(); foreach ($list as $key => $val) { $user = M('Userinfo')->where(array('token' => $this->token, 'wecha_id' => $val['wecha_id']))->field('wechaname,tel')->find(); $list[$key]['tel'] = $user['tel']; $list[$key]['name'] = $user['wechaname']; } $this->assign('list', $list); $send = $box->where(array('bid' => $id, 'isprize' => 1, 'sendstutas' => 1))->count(); $this->assign('send', $send); $count = $box->where(array('bid' => $id, 'isprize' => 1, 'isprizes' => 1))->count(); $this->assign('count', $count); $lottery = M('Activity')->where(array('id' => $lid, 'token' => $this->token))->find(); $this->assign('id', $id); $this->display(); }
public function index() { $frontuser = M('Users')->where($this->belong_where)->select(); foreach ($frontuser as $val) { $belong_where_wx .= $val['id'] . ','; } $map = array(); $map['uid'] = array('in', $belong_where_wx); $UserDB = D('Wxuser'); $count = $UserDB->where($map)->count(); $Page = new Page($count, 10); // 实例化分页类 传入总记录数 // 进行分页数据查询 注意page方法的参数的前面部分是当前的页数使用 $_GET[p]获取 $nowPage = isset($_GET['p']) ? $_GET['p'] : 1; $show = $Page->show(); // 分页显示输出 $list = $UserDB->where($map)->order('id ASC')->limit($Page->firstRow . ',' . $Page->listRows)->order('id desc')->select(); foreach ($list as $key => $value) { $user = M('Users')->field('id,gid,username,belonguser')->where(array('id' => $value['uid']))->find(); if ($user) { $list[$key]['user']['username'] = $user['username']; $list[$key]['user']['gid'] = $user['gid'] - 1; $back_user = M('user')->where(array('id' => $user['belonguser']))->find(); $list[$key]['user']['backusername'] = $back_user['username']; } } //dump($list); $this->assign('list', $list); $this->assign('page', $show); // 赋值分页输出 $this->display(); }
public function index($id){ //实例化评论表对象 $mod = M("Libcom"); //导入分页类 import("ORG.Util.Page"); //设置搜索条件 $where['lid'] = array("eq",$id); //设置分页条件 $total = $mod->where($where)->count();//获取总数据条数 $page = new Page($total,5);//实例化一个分页对象 //查询评论信息 $list = $mod->where($where)->order("addtime desc")->limit($page->firstRow.",".$page->listRows)->select(); //循环遍历查询结果集执行用户名追加 //$cid = array();//定义该资源所有评论的id foreach ($list as &$v) { $ob = D("Users")->field("username,picture")->find($v['uid']); $v['username'] = $ob['username']; $v['picture'] = $ob['picture']; //$cid[] = $v['id'];//把遍历出的id存进数组 } $this->assign("list",$list); $this->assign("comTotal",$total);//赋值模板评论条数 $this->assign("comPage",$page->show());//给模板赋值分页信息 }
public function index(){ $data = M('Wehcat_member_enddate'); $count = $data -> where(array('token' => $_SESSION['token'])) -> count(); $Page = new Page($count, 50); $show = $Page -> show(); $list = $data -> where(array('token' => $_SESSION['token'], 'uid' => session('userId'))) -> order('enddate desc') -> limit($Page -> firstRow . ',' . $Page -> listRows) -> select(); foreach($list as $key => $limen){ $dataUp['joinUpDate'] = time(); $dataUp['uid'] = session('userId'); $dataUp['id'] = $limen['id']; M('wehcat_member_enddate') -> data($dataUp) -> save(); $userInfo = M('wechat_group_list') -> order('id desc') -> where(array('openid' => $limen['openid'])) -> find(); $list1[$key]['endtime'] = $this -> getTime($limen['enddate'], 'mohu'); $list1[$key]['nickname'] = $userInfo['nickname']; $list1[$key]['headimgurl'] = $userInfo['headimgurl']; $list1[$key]['id'] = $userInfo['id']; $list1[$key]['city'] = $userInfo['city']; $list1[$key]['openid'] = $limen['openid']; $list1[$key]['subscribe_time'] = $this -> getTime($userInfo['subscribe_time'], 'normal'); } $where['token'] = session('token'); $where['id'] = session('userId'); $where['endJoinDate'] = time(); M('Service_user') -> data($where) -> save(); $this -> assign('page', $show); $this -> assign('list', $list1); $this -> display(); }
public function financeDetail() { import("ORG.Util.Page"); $map['is_stock'] = array("in", "1,2"); $count = M("ausers")->where($map)->count(); $p = new Page($count, C('ADMIN_PAGE_SIZE')); $page = $p->show(); $Lsql = "{$p->firstRow},{$p->listRows}"; $list = M("ausers")->where($map)->limit($Lsql)->select(); foreach ($list as $k => $v) { if ($v['is_stock'] == 2) { $com = getComsById($v['id']); $com = $com * $this->glo['commision_ratio'] / 100; $com = $com * $this->glo['commision_ratio'] / 100; $list[$k]['all_commission'] = $com; } else { $com = getComById($v['id']); $com = $com * $this->glo['commision_ratio'] / 100; $list[$k]['all_commission'] = $com; } } $this->assign("list", $list); $this->assign("pagebar", $page); $this->display(); }
public function getList($where = array(), $order = false, $limit = false, $page = false, $group = false) { $data = array(); if ($page) { import('ORG.Util.Page'); $count = $this->where($where)->count(); $limit = $limit ? $limit : 10; $Page = new Page($count, $limit); $data['page'] = $Page->show(); if ($group) { $this->group($group); } if ($order) { $this->order($order); } $this->limit($Page->firstRow . ',' . $Page->listRows); $data['list'] = $this->where($where)->select(); } else { if ($limit) { $this->limit($limit); } if ($group) { $this->group($group); } if ($order) { $this->order($order); } $data = $this->where($where)->select(); } return $data; }
public function index() { $map = array(); if (C('agent_version')) { $map['agentid'] = array('lt', 1); } $UserDB = D('User_group'); $count = $UserDB->where($map)->count(); $Page = new Page($count, 15); // 实例化分页类 传入总记录数 // 进行分页数据查询 注意page方法的参数的前面部分是当前的页数使用 $_GET[p]获取 $nowPage = isset($_GET['p']) ? $_GET['p'] : 1; $show = $Page->show(); // 分页显示输出 $list = $UserDB->where($map)->order('id ASC')->page($nowPage . ',' . C('PAGE_NUM'))->select(); if ($list) { $i = 1; foreach ($list as $item) { $UserDB->where(array('id' => $item['id']))->save(array('taxisid' => $i)); $i++; } } $this->assign('list', $list); $this->assign('page', $show); // 赋值分页输出 $this->display(); }
public function sysmsg($re = false) { $map['uid'] = $this->uid; //分页处理 import("ORG.Util.Page"); $count = M('inner_msg')->where($map)->count('id'); $p = new Page($count, 15); $page = $p->show(); $Lsql = "{$p->firstRow},{$p->listRows}"; //分页处理 $list = M('inner_msg')->where($map)->order('id DESC')->limit($Lsql)->select(); $read = M("inner_msg")->where("uid={$this->uid} AND status=1")->count('id'); $this->assign("list", $list); $this->assign("pagebar", $page); $this->assign("read", $read); $this->assign("unread", $count - $read); $this->assign("count", $count); if (true === $re) { $dpage = array(); $dpage['numpage'] = $count ? ceil($count / 15) : 1; $dpage['curpage'] = (int) $_GET['p'] ? (int) $_GET['p'] : 1; $this->assign("dpage", $dpage); return $list; } $data['html'] = $this->fetch(); exit(json_encode($data)); }
public function index(){ $map = array(); $UserDB = D('Wxuser'); if (isset($_GET['agentid'])){ $map=array('agentid'=>intval($_GET['agentid'])); } $count = $UserDB->where($map)->count(); $Page = new Page($count,5);// 实例化分页类 传入总记录数 // 进行分页数据查询 注意page方法的参数的前面部分是当前的页数使用 $_GET[p]获取 $nowPage = isset($_GET['p'])?$_GET['p']:1; $show = $Page->show();// 分页显示输出 $list = $UserDB->where($map)->order('id ASC')->limit($Page->firstRow.','.$Page->listRows)->order('id desc')->select(); foreach($list as $key=>$value){ $user=M('Users')->field('id,gid,username')->where(array('id'=>$value['uid']))->find(); if($user){ $list[$key]['user']['username']=$user['username']; $list[$key]['user']['gid']=$user['gid']-1; } } //dump($list); $this->assign('list',$list); $this->assign('page',$show);// 赋值分页输出 $this->display(); }
public function history() { if (!$GLOBALS['user_info']) { app_redirect(url("user#login")); } $dest_user_id = intval($_REQUEST['id']); $dest_user_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $dest_user_id . " and is_effect = 1"); if (!$dest_user_info) { app_redirect(url("message")); } $GLOBALS['db']->query("update " . DB_PREFIX . "user_message set is_read = 1 where user_id = " . intval($GLOBALS['user_info']['id']) . " and dest_user_id = " . $dest_user_id); $page_size = 20; $page = intval($_REQUEST['p']); if ($page == 0) { $page = 1; } $limit = ($page - 1) * $page_size . "," . $page_size; $sql = "select * from " . DB_PREFIX . "user_message where user_id = " . intval($GLOBALS['user_info']['id']) . " and dest_user_id = " . $dest_user_id . " order by create_time desc limit " . $limit; $sql_count = "select count(*) from " . DB_PREFIX . "user_message where user_id = " . intval($GLOBALS['user_info']['id']) . " and dest_user_id = " . $dest_user_id; $message_list = $GLOBALS['db']->getAll($sql); $message_count = $GLOBALS['db']->getOne($sql_count); $GLOBALS['tmpl']->assign("dest_user_info", $dest_user_info); $GLOBALS['tmpl']->assign("message_list", $message_list); require APP_ROOT_PATH . 'app/Lib/page.php'; $page = new Page($message_count, $page_size); //初始化分页对象 $p = $page->show(); $GLOBALS['tmpl']->assign('pages', $p); $GLOBALS['tmpl']->display("message_history.html"); }
public function records(){ $db = D('Share'); $where['token'] = $this -> token; $count = $db -> where($where) -> count(); $page = new Page($count, 25); $info = $db -> where($where) -> order('id DESC') -> limit($page -> firstRow . ',' . $page -> listRows) -> select(); $wecha_ids = array(); if ($info){ foreach ($info as $item){ if (!in_array($item['wecha_id'], $wecha_ids)){ array_push($wecha_ids, $item['wecha_id']); } } $users = M('Userinfo') -> where(array('wecha_id' => array('in', $wecha_ids))) -> select(); if ($users){ foreach ($users as $useritem){ $users[$useritem['wecha_id']] = $useritem; } } $i = 0; foreach ($info as $item){ $info[$i]['user'] = $users[$item['wecha_id']]; $info[$i]['moduleName'] = funcDict :: moduleName($item['module']); $i++; } } $this -> assign('page', $page -> show()); $this -> assign('info', $info); $this -> assign('tab', 'records'); $this -> display(); }
public function index() { if (!USER_LOGINED) { jump(U('Public/login')); } global $member; import('@.ORG.Page'); $status = $this->_get('status', false); $status = empty($status) ? 0 : $status; if ($status == 0) { $map['arcrank'] = array('in', '1,2,3'); } elseif ($status == 1) { $map['arcrank'] = array('in', '4'); } $map['mid'] = $member['id']; $model = D('ArchiveView'); $count = $model->where($map)->count(); $fenye = 20; $p = new Page($count, $fenye); $list = $model->field('litpic,id,typeid,modelid,arcrank,title,flag,color,click,pubdate,mid,username,description')->where($map)->limit($p->firstRow . ',' . $p->listRows)->order('pubdate desc')->select(); $p->setConfig('prev', '上一页'); $p->setConfig('header', '条记录'); $p->setConfig('first', '首 页'); $p->setConfig('last', '末 页'); $p->setConfig('next', '下一页'); $p->setConfig('theme', "%first%%upPage%%linkPage%%downPage%%end%<li><span>共<font color='#009900'><b>%totalRow%</b></font>条记录 " . $fenye . "条/每页</span></li>\n"); $this->assign('page', $p->show()); $this->assign('list', $list); $this->display(); }
public function index() { $page = intval($_REQUEST['p']); if ($page == 0) { $page = 1; } $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE"); $result = get_invite_list($limit, $GLOBALS['user_info']['id']); $GLOBALS['tmpl']->assign("list", $result['list']); $page = new Page($result['count'], app_conf("PAGE_SIZE")); //初始化分页对象 $p = $page->show(); $GLOBALS['tmpl']->assign('pages', $p); $total_referral_money = $GLOBALS['db']->getOne("select sum(money) from " . DB_PREFIX . "referrals where user_id = " . $GLOBALS['user_info']['id'] . " and pay_time > 0"); $total_referral_score = $GLOBALS['db']->getOne("select sum(score) from " . DB_PREFIX . "referrals where user_id = " . $GLOBALS['user_info']['id'] . " and pay_time > 0"); $GLOBALS['tmpl']->assign("total_referral_money", $total_referral_money); $GLOBALS['tmpl']->assign("total_referral_score", $total_referral_score); $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['UC_INVITE']); $GLOBALS['tmpl']->assign("inc_file", "inc/uc/uc_invite_index.html"); $share_url = get_domain() . APP_ROOT . "/"; if ($GLOBALS['user_info']) { $share_url .= "?r=" . base64_encode(intval($GLOBALS['user_info']['id'])); } $GLOBALS['tmpl']->assign("share_url", $share_url); $GLOBALS['tmpl']->display("uc.html"); }