Ecshop page implementation of custom pages in the application using the ECS self-contained pager
Last Update:2018-07-26
Source: Internet
Author: User
/*------------------------------------------------------ */
--Shop Service list
/*------------------------------------------------------ */
if ($_request[' act '] = = ' list ')
{
/* Check Permissions */
Admin_priv (' Shop_service ');
Include pagination method
$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 the->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 in 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 in 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 ' and ' = ' $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 the->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 in 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 in 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 ' and ' = ' $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 ']);
}