地区 :[ 切换城市 ]       新闻 娱乐 企业 博客 视频 工具 网站建设 开发者 旅行 社区

手机生活网

【分页数量】Webmeng 分类 现实数量定义

  • 2018-01-20 05:14:10 发布
  • 浏览:9189 次
  • 近一个月发布3条帖子
【分页数量】Webmeng 分类 现实数量定义
市微信朋友圈广告开户,广告制作,广告投放。
9级金牌商家

超过98%同行

会员2年 营业执照认证
服务支持
先行赔付
35个月
加入生活网
347个
发布帖子
2000元
保障金
  • 人气 3.0 ↑
  • 活跃 3.0 ↑
  • 服务 3.9 -

温馨提示:1、在办理服务前请确认对方资质, 夸大的宣传和承诺不要轻信!2.任何要求预付定金、汇款至个人银行账户等方式均存在风险,谨防上当受骗!

设施服务

更多参数
是否上门
上门服务

服务描述

分类 现实数量定义


public function category($catid)

{
$catid = str_replace("template/category/","",$catid);
$catid=(int) $catid;

$search='';
if(!empty($catid)){
$sortpath=$this->db->fetch_one("select sort_path from ".WEBMENG_CONMENG."category_templates_web where cat_id='".$catid."' ");
$search.=" and catid in(select cat_id from ".WEBMENG_CONMENG."category_templates_web where sort_path like '".$sortpath."%' ) ";
}

//$sql = "select *,thumb as img,inputtime as addtime from ".WEBMENG_CONMENG."templates_web where status>0 order by inputtime desc ".$search;
$sql = "select *,thumb as img,inputtime as addtime from ".WEBMENG_CONMENG."templates_web where status>0  ".$search;

$all_goods = page_for_db_extend($sql,'',18);  //查询带分页的每一页显示18条记录
// $all_goods = page_for_db_extend($sql);  //查询带分页的
$data = array(
'info_reslut' => $all_goods['data'],
'showpage'    => $all_goods['page'],
'template_count' => $all_news['total'],
//'category_web'   => $template_list
'templates_web'   => $this->category_templates_web()
);
$this->display('cn/template/category.html',$data);
}



public function category_templates_web()
{
$goods_list  = $this->db->fetch("select cat_name as sortname,cat_id as id,parent_id from ".WEBMENG_CONMENG."category_templates_web  ");
$templates_web = array();
$parent = array();
if(!empty($goods_list)){
foreach ($goods_list as  $v) {
if($v['parent_id']==0){
$templates_web[] = $v;
}
$parent[$v['parent_id']][]=$v;
}
foreach ($templates_web as $k => $v) {
$templates_web[$k]['child'] = isset($parent[$v['id']])?$parent[$v['id']]:array();
if(!empty($templates_web[$k]['child'])){
foreach ($templates_web[$k]['child'] as $key => $value) {
$templates_web[$k]['child'][$key]['child'] = isset($parent[$value['id']])?$parent[$value['id']]:array();
}
}
}
}
return $templates_web;
}





联系我时,请说是在 看到的,谢谢!


店铺信息

筛选
深圳
全部区域
© 2018 Baidu - GS(2016)2089号 - 甲测资字1100930 - 京ICP证030173号 - Data © 创梦科技

猜你喜欢

    您好!没有信息,请您浏览其它内容。

您可能感兴趣


  • 您好!没有信息,请您浏览其它内容。
其他人还浏览
    您好!没有信息,请您浏览其它内容。