本文整理汇总了PHP中lazypage函数的典型用法代码示例。如果您正苦于以下问题:PHP lazypage函数的具体用法?PHP lazypage怎么用?PHP lazypage使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了lazypage函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: stracelistOp
/**
* 买家中心店铺动态
*/
public function stracelistOp(){
//查询收藏的店铺
$model_favorites = Model('favorites');
//条件
$where = array('member_id' => $_SESSION['member_id']);
$fav_store_id = $model_favorites->getStoreFavoritesList($where, 'fav_id');
// 整理
if(!empty($fav_store_id) && is_array($fav_store_id)){
$storeid_array = '';
foreach($fav_store_id as $val){
$storeid_array[] = $val['fav_id'];
}
$where = array(
'strace_storeid'=>array('in',$storeid_array),
'strace_state'=>1
);
$model_stracelog = Model('store_sns_tracelog');
$count = $model_stracelog->getStoreSnsTracelogCount($where);
//分页
$page = new Page();
$page->setEachNum(30);
$page->setStyle('admin');
$page->setTotalNum($count);
$delaypage = intval($_GET['delaypage'])>0?intval($_GET['delaypage']):1;//本页延时加载的当前页数
$lazy_arr = lazypage(10,$delaypage,$count,true,$page->getNowPage(),$page->getEachNum(),$page->getLimitStart());
//动态列表
$limit = $lazy_arr['limitstart'].",".$lazy_arr['delay_eachnum'];
$strace_array = $count = $model_stracelog->getStoreSnsTracelogList($where, '*', 'strace_id desc', $limit);
if (!empty($strace_array)){
foreach ($strace_array as $key=>$val){
if($val['strace_content'] == ''){
$val['strace_goodsdata'] = json_decode($val['strace_goodsdata'],true);
if( CHARSET == 'GBK') {
foreach ((array)$val['strace_goodsdata'] as $k=>$v){
$val['strace_goodsdata'][$k] = Language::getGBK($v);
}
}
$content = $model_stracelog->spellingStyle($val['strace_type'], $val['strace_goodsdata']);
$strace_array[$key]['strace_content'] = str_replace("%siteurl%", SHOP_SITE_URL.DS, $content);
}
}
}
Tpl::output('show_page',$page->show());
}
Tpl::output('hasmore',$lazy_arr['hasmore']);
Tpl::output('strace_array',$strace_array);
Tpl::output('type','index');
Tpl::showpage('member_storesns.tracelist','null_layout');
}
示例2: tracelistOp
/**
* SNS动态列表
*/
public function tracelistOp(){
//查询关注以及好友列表
$friend_model = Model('sns_friend');
$friend_list = $friend_model->listFriend(array('friend_frommid'=>"{$_SESSION['member_id']}"),'*','','simple');
$mutualfollowid_arr = array();
$followid_arr = array();
if (!empty($friend_list)){
foreach ($friend_list as $k=>$v){
$followid_arr[] = $v['friend_tomid'];
if ($v['friend_followstate'] == 2){
$mutualfollowid_arr[] = $v['friend_tomid'];
}
}
}
$tracelog_model = Model('sns_tracelog');
//条件
$condition = array();
$condition['allowshow'] = '1';
$condition['allowshow_memberid'] = "{$_SESSION['member_id']}";
$condition['allowshow_followerin'] = "";
if (!empty($followid_arr)){
$condition['allowshow_followerin'] = implode("','",$followid_arr);
}
$condition['allowshow_friendin'] = "";
if (!empty($mutualfollowid_arr)){
$condition['allowshow_friendin'] = implode("','",$mutualfollowid_arr);
}
$condition['trace_state'] = "0";
$count = $tracelog_model->countTrace($condition);
//分页
$page = new Page();
$page->setEachNum(30);
$page->setStyle('admin');
$page->setTotalNum($count);
$delaypage = intval($_GET['delaypage'])>0?intval($_GET['delaypage']):1;//本页延时加载的当前页数
$lazy_arr = lazypage(10,$delaypage,$count,true,$page->getNowPage(),$page->getEachNum(),$page->getLimitStart());
//动态列表
$condition['limit'] = $lazy_arr['limitstart'].",".$lazy_arr['delay_eachnum'];
$tracelist = $tracelog_model->getTracelogList($condition);
if (!empty($tracelist)){
foreach ($tracelist as $k=>$v){
if ($v['trace_title']){
$v['trace_title'] = str_replace("%siteurl%", SHOP_SITE_URL.DS, $v['trace_title']);
$v['trace_title_forward'] = '|| @'.$v['trace_membername'].Language::get('nc_colon').preg_replace("/<a(.*?)href=\"(.*?)\"(.*?)>@(.*?)<\/a>([\s|:|:]|$)/is",'@${4}${5}',$v['trace_title']);
}
if(!empty($v['trace_content'])){
//替换内容中的siteurl
$v['trace_content'] = str_replace("%siteurl%", SHOP_SITE_URL.DS, $v['trace_content']);
}
$tracelist[$k] = $v;
}
}
Tpl::output('hasmore',$lazy_arr['hasmore']);
Tpl::output('tracelist',$tracelist);
Tpl::output('show_page',$page->show());
Tpl::output('type','index');
Tpl::showpage('member_snstracelist','null_layout');
}
示例3: tracelistOp
/**
* 某会员的SNS动态列表
*/
public function tracelistOp()
{
$tracelog_model = Model('sns_tracelog');
$condition = array();
$condition['trace_memberid'] = $this->master_id;
switch ($this->relation) {
case 3:
$condition['trace_privacyin'] = "";
break;
case 2:
$condition['trace_privacyin'] = "0','1";
break;
case 1:
$condition['trace_privacyin'] = "0";
break;
default:
$condition['trace_privacyin'] = "0";
break;
}
$condition['trace_state'] = "0";
$count = $tracelog_model->countTrace($condition);
//分页
$page = new Page();
$page->setEachNum(30);
$page->setStyle('admin');
$page->setTotalNum($count);
$delaypage = intval($_GET['delaypage']) > 0 ? intval($_GET['delaypage']) : 1;
//本页延时加载的当前页数
$lazy_arr = lazypage(10, $delaypage, $count, true, $page->getNowPage(), $page->getEachNum(), $page->getLimitStart());
//动态列表
$condition['limit'] = $lazy_arr['limitstart'] . "," . $lazy_arr['delay_eachnum'];
$tracelist = $tracelog_model->getTracelogList($condition);
if (!empty($tracelist)) {
foreach ($tracelist as $k => $v) {
if ($v['trace_title']) {
$v['trace_title'] = str_replace("%siteurl%", SHOP_SITE_URL . DS, $v['trace_title']);
$v['trace_title_forward'] = '|| @' . $v['trace_membername'] . Language::get('nc_colon') . preg_replace("/<a(.*?)href=\"(.*?)\"(.*?)>@(.*?)<\\/a>([\\s|:|:]|\$)/is", '@${4}${5}', $v['trace_title']);
}
if (!empty($v['trace_content'])) {
//替换内容中的siteurl
$v['trace_content'] = str_replace("%siteurl%", SHOP_SITE_URL . DS, $v['trace_content']);
}
$tracelist[$k] = $v;
}
}
Tpl::output('hasmore', $lazy_arr['hasmore']);
Tpl::output('tracelist', $tracelist);
Tpl::output('show_page', $page->show());
Tpl::output('type', 'home');
//验证码
Tpl::output('nchash', substr(md5(SHOP_SITE_URL . $_GET['act'] . $_GET['op']), 0, 8));
Tpl::output('menu_sign', 'snstrace');
Tpl::showpage('sns_tracelist', 'null_layout');
}
示例4: findlistOp
/**
* 找人搜索列表
*/
public function findlistOp()
{
if (trim($_POST['searchname']) != '') {
// 实例化模型
$model = Model();
//查询关注会员id
$followlist = $model->table('sns_friend')->field('friend_tomid, friend_followstate')->where(array('friend_frommid' => $_SESSION['member_id']))->select();
unset($condition_arr);
$followlist_new = array();
if (!empty($followlist)) {
foreach ($followlist as $k => $v) {
$followlist_new[$v['friend_tomid']] = $v;
}
}
//查询会员
// 查询条件
$where = array();
$where['member_state'] = 1;
$where['member_id'] = array('neq', $_SESSION['member_id']);
$where['member_name'] = array('like', '%' . trim($_POST['searchname']) . '%');
// 会员名称
// 省份
if (intval($_POST['provinceid']) > 0) {
$where['member_provinceid'] = intval($_POST['provinceid']);
}
// 城市
if (intval($_POST['cityid']) > 0) {
$where['member_cityid'] = intval($_POST['cityid']);
}
// 地区
if (intval($_POST['areaid']) > 0) {
$where['member_areainfo'] = intval($_POST['areaid']);
}
// 性别
if (intval($_POST['sex']) > 0) {
$where['member_sex'] = intval($_POST['sex']);
}
// 年龄
if (intval($_POST['age']) > 0) {
switch (intval($_POST['age'])) {
case 1:
$s_time = date('Y') - 18 . '-' . date('m-d');
$e_time = date('Y-m-d');
$where['member_birthday'] = array('BETWEEN', $s_time . ',' . $e_time);
break;
case 2:
$s_time = date('Y') - 24 . '-' . date('m-d');
$e_time = date('Y') - 18 . '-' . date('m-d');
$where['member_birthday'] = array('BETWEEN', $s_time . ',' . $e_time);
break;
case 3:
$s_time = date('Y') - 24 . '-' . date('m-d');
$e_time = date('Y') - 18 . '-' . date('m-d');
$where['member_birthday'] = array('BETWEEN', $s_time . ',' . $e_time);
break;
case 4:
$s_time = date('Y') - 30 . '-' . date('m-d');
$e_time = date('Y') - 24 . '-' . date('m-d');
$where['member_birthday'] = array('BETWEEN', $s_time . ',' . $e_time);
break;
case 5:
$e_time = date('Y') - 30 . '-' . date('m-d');
$where['member_birthday'] = array('elt', $e_time);
break;
}
}
$count = $model->table('member')->where($where)->count();
$memberlist = array();
if ($count > 0) {
$delaypage = intval($_POST['delaypage']) > 0 ? intval($_POST['delaypage']) : 1;
//本页延时加载的当前页数
$lazy_arr = lazypage(15, $delaypage, $count);
$limit = $lazy_arr['limitstart'] . "," . $lazy_arr['delay_eachnum'];
$memberlist = $model->table('member')->where($where)->limit($limit)->select();
if (!empty($memberlist)) {
$followid_arr = array_keys($followlist_new);
foreach ($memberlist as $k => $v) {
if (in_array($v['member_id'], $followid_arr)) {
$v['followstate'] = $followlist_new[$v['member_id']]['friend_followstate'];
} else {
$v['followstate'] = 0;
}
//性别
$v['sex_class'] = $this->m_sex($v['member_sex']);
$memberlist[$k] = $v;
}
}
Tpl::output('hasmore', $lazy_arr['hasmore']);
}
}
//查询会员信息
$this->get_member_info();
Tpl::output('memberlist', $memberlist);
self::profile_menu('find');
Tpl::output('menu_sign', 'friend');
Tpl::output('header_menu_sign', 'friend');
//默认选中顶部“好友”菜单
//.........这里部分代码省略.........