ecshop中自定义页面的分页实现使用ecs自带分页程序
来源:互联网 发布:飞鹰网络电视手机版 编辑:程序博客网 时间:2024/05/21 21:01
/*------------------------------------------------------ */
//-- 商铺服务列表
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'list')
{
/* 检查权限 */
admin_priv('shop_service');
//包含分页方法
$sql = "SELECT COUNT(*) FROM " . $ecs->table('shop_service') . " where status=1";
$filter['record_count'] = $GLOBALS['db']->getOne($sql);
$filter = page_and_size($filter);
$sql = "SELECT a.id as service_id,a.user_id,a.option_id,a.service_name,a.market_price,a.promote_price,a.list_page_img,from_unixtime(a.create_time) as create_time,a.service_count,a.type,b.shop_mobile_phone,b.truename,c.option_name,d.type_name,e.img_url as list_page_img FROM ".$ecs->table('shop_service')." as a left join ecs_business_service_join as b on a.user_id=b.user_id left join ecs_service_option as c on a.option_id=c.id left join ecs_join_shop_type as d on b.shop_type=d.id left join ecs_user_pic as e on a.list_page_img=e.id where a.status=1 order by a.create_time LIMIT " . $filter['start'] . ',' . $filter['page_size'];
set_filter($filter, $sql);
$rs = $GLOBALS['db']->getAll($sql);
foreach($rs as $k=>$v){
if($v['list_page_img'] != ''){
$rs[$k]['list_page_img'] = SITE_URL . 'Public/uploads/' . $v['list_page_img'];
}else{
$rs[$k]['list_page_img'] = SITE_URL . 'Public/uploads/' . 'default.png';
}
}
$lists = array('shop_service_list' => $rs, 'filter' => $filter,
'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
$smarty->assign('shop_service_list', $lists['shop_service_list']);
$smarty->assign('filter', $lists['filter']);
$smarty->assign('record_count', $lists['record_count']);
$smarty->assign('page_count', $lists['page_count']);
$smarty->assign('full_page', 1);
$smarty->display('shop_service_list.htm');
}
elseif ($_REQUEST['act'] == 'query'){
$sql = "SELECT COUNT(*) FROM " . $ecs->table('shop_service') . " where status=1";
$filter['record_count'] = $GLOBALS['db']->getOne($sql);
$filter = page_and_size($filter);
$sql = "SELECT a.id as service_id,a.user_id,a.option_id,a.service_name,a.market_price,a.promote_price,a.list_page_img,from_unixtime(a.create_time) as create_time,a.service_count,a.type,b.shop_mobile_phone,b.truename,c.option_name,d.type_name,e.img_url as list_page_img FROM ".$ecs->table('shop_service')." as a left join ecs_business_service_join as b on a.user_id=b.user_id left join ecs_service_option as c on a.option_id=c.id left join ecs_join_shop_type as d on b.shop_type=d.id left join ecs_user_pic as e on a.list_page_img=e.id where a.status=1 order by a.create_time LIMIT " . $filter['start'] . ',' . $filter['page_size'];
set_filter($filter, $sql);
$rs = $GLOBALS['db']->getAll($sql);
foreach($rs as $k=>$v){
if($v['list_page_img'] != ''){
$rs[$k]['list_page_img'] = SITE_URL . 'Public/uploads/' . $v['list_page_img'];
}else{
$rs[$k]['list_page_img'] = SITE_URL . 'Public/uploads/' . 'default.png';
}
}
$lists = array('shop_service_list' => $rs, 'filter' => $filter,
'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
$smarty->assign('shop_service_list', $lists['shop_service_list']);
$smarty->assign('filter', $lists['filter']);
$smarty->assign('record_count', $lists['record_count']);
$smarty->assign('page_count', $lists['page_count']);
$smarty->assign('full_page', 1);
make_json_result($smarty->fetch('shop_service_list.htm'), '', array('filter' => $lists['filter'], 'page_count' => $lists['page_count']));
}
//-- 商铺服务列表
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'list')
{
/* 检查权限 */
admin_priv('shop_service');
//包含分页方法
$sql = "SELECT COUNT(*) FROM " . $ecs->table('shop_service') . " where status=1";
$filter['record_count'] = $GLOBALS['db']->getOne($sql);
$filter = page_and_size($filter);
$sql = "SELECT a.id as service_id,a.user_id,a.option_id,a.service_name,a.market_price,a.promote_price,a.list_page_img,from_unixtime(a.create_time) as create_time,a.service_count,a.type,b.shop_mobile_phone,b.truename,c.option_name,d.type_name,e.img_url as list_page_img FROM ".$ecs->table('shop_service')." as a left join ecs_business_service_join as b on a.user_id=b.user_id left join ecs_service_option as c on a.option_id=c.id left join ecs_join_shop_type as d on b.shop_type=d.id left join ecs_user_pic as e on a.list_page_img=e.id where a.status=1 order by a.create_time LIMIT " . $filter['start'] . ',' . $filter['page_size'];
set_filter($filter, $sql);
$rs = $GLOBALS['db']->getAll($sql);
foreach($rs as $k=>$v){
if($v['list_page_img'] != ''){
$rs[$k]['list_page_img'] = SITE_URL . 'Public/uploads/' . $v['list_page_img'];
}else{
$rs[$k]['list_page_img'] = SITE_URL . 'Public/uploads/' . 'default.png';
}
}
$lists = array('shop_service_list' => $rs, 'filter' => $filter,
'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
$smarty->assign('shop_service_list', $lists['shop_service_list']);
$smarty->assign('filter', $lists['filter']);
$smarty->assign('record_count', $lists['record_count']);
$smarty->assign('page_count', $lists['page_count']);
$smarty->assign('full_page', 1);
$smarty->display('shop_service_list.htm');
}
elseif ($_REQUEST['act'] == 'query'){
$sql = "SELECT COUNT(*) FROM " . $ecs->table('shop_service') . " where status=1";
$filter['record_count'] = $GLOBALS['db']->getOne($sql);
$filter = page_and_size($filter);
$sql = "SELECT a.id as service_id,a.user_id,a.option_id,a.service_name,a.market_price,a.promote_price,a.list_page_img,from_unixtime(a.create_time) as create_time,a.service_count,a.type,b.shop_mobile_phone,b.truename,c.option_name,d.type_name,e.img_url as list_page_img FROM ".$ecs->table('shop_service')." as a left join ecs_business_service_join as b on a.user_id=b.user_id left join ecs_service_option as c on a.option_id=c.id left join ecs_join_shop_type as d on b.shop_type=d.id left join ecs_user_pic as e on a.list_page_img=e.id where a.status=1 order by a.create_time LIMIT " . $filter['start'] . ',' . $filter['page_size'];
set_filter($filter, $sql);
$rs = $GLOBALS['db']->getAll($sql);
foreach($rs as $k=>$v){
if($v['list_page_img'] != ''){
$rs[$k]['list_page_img'] = SITE_URL . 'Public/uploads/' . $v['list_page_img'];
}else{
$rs[$k]['list_page_img'] = SITE_URL . 'Public/uploads/' . 'default.png';
}
}
$lists = array('shop_service_list' => $rs, 'filter' => $filter,
'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
$smarty->assign('shop_service_list', $lists['shop_service_list']);
$smarty->assign('filter', $lists['filter']);
$smarty->assign('record_count', $lists['record_count']);
$smarty->assign('page_count', $lists['page_count']);
$smarty->assign('full_page', 1);
make_json_result($smarty->fetch('shop_service_list.htm'), '', array('filter' => $lists['filter'], 'page_count' => $lists['page_count']));
}
0 0
- ecshop中自定义页面的分页实现使用ecs自带分页程序
- DataGrid中自带的分页功能的使用
- DataGrid中自带的分页功能的使用
- Yii2中自带分页类实现分页
- GridView自带的分页功能实现
- GridView自带的分页功能实现
- 使用GridView自带分页的代码
- 使用GridView自带分页的代码
- ecshop 中分页的介绍
- ecshop 中category 页面分页page_size
- DataGrid的自带分页
- ibatis 自带的分页
- yii中实现数组分页(用yii自带控件实现自己定义列表分页)
- YII框架中自带的表单,搜索,分页代码的实现
- YII框架中自带的表单,搜索,分页代码的实现
- YII框架中自带的表单,搜索,分页代码的实现
- ecshop 分页增加自定义参数,以投票页面为例
- 页面分页的实现
- ORA-09817错误
- java中fianl的使用
- 限制文本框只能输入数字
- 本文只为记录,自学 CAAnaimation 中正在学习中...
- 降低对象的引用级别到软引用 class SoftValueMap<K, V> extends HashMap<K, V>
- ecshop中自定义页面的分页实现使用ecs自带分页程序
- RPC原理详解
- Java-day02基础语法
- SOUI GDI+渲染引擎下的字体特效
- C语言使用回调函数解决内存申请和释放的问题
- 20个数据库设计最佳实践
- NGUI制作字体的三种方法
- 二维数组中的查找
- eclipse 启动失败