当前位置: 首页>>代码示例>>PHP>>正文


PHP obj::prductClassMenu方法代码示例

本文整理汇总了PHP中obj::prductClassMenu方法的典型用法代码示例。如果您正苦于以下问题:PHP obj::prductClassMenu方法的具体用法?PHP obj::prductClassMenu怎么用?PHP obj::prductClassMenu使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在obj的用法示例。


在下文中一共展示了obj::prductClassMenu方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: showClass

 /**
  * 显示商品分类页面
  *
  */
 private function showClass()
 {
     if (intval($this->_input['classid']) == 0) {
         header("Location:index.php");
         exit;
     }
     include BasePath . "/share/" . NC_SHOP_DIR . "goods_class_show.php";
     $array = array();
     foreach ($node_cache as $k => $v) {
         if ($v[0] == intval($this->_input['classid'])) {
             $array['class_id'] = $v[0];
             $array['class_top_id'] = $v[1];
             $array['class_name'] = $v[2];
             $array['class_keywords'] = $v[6];
             $array['class_description'] = $v[7];
             $array['key_id'] = $k;
             break;
         }
     }
     /*当前分类信息*/
     $this->output('class_info', $array);
     /*分类导航*/
     $class_menu = $this->obj_product_class->prductClassMenu($array);
     $this->output('class_menu', $class_menu);
     /*下一级分类*/
     $sub_array = $this->obj_product_class->getSpecificClass(array('sub_class_id' => $array['class_id']));
     $this->output('sub_class', $sub_array);
     $this->output('sub_class_num', count($sub_array));
     /*创建分页对象*/
     $view_list_num = $this->_viewinfo['websit']['other_goods_class'] == '1' ? (int) $this->_viewinfo['websit']['other_goods_class_num'] : 0;
     if (intval($this->_input['goods_nums']) != 0) {
         $view_list_num = intval($this->_input['goods_nums']);
     }
     require_once "commonpage.class.php";
     $obj_page = new CommonPage();
     $obj_page->pagebarnum($view_list_num);
     //每页显示商品数
     $product_array = $this->obj_product_class->productClassList($array, $obj_page, '*', $this->_input['goods_show']);
     $product_class_page = $obj_page->show(6);
     $this->output('product_class_page', $product_class_page);
     $this->output('product_array', $product_array);
     /*商品品牌*/
     $brand_array = $this->obj_brand->getBrandList(array('show_type' => 'class_show'));
     $this->output('brand_array', $brand_array);
     /*当前类热卖商品*/
     $hot_array = $this->obj_product_class->productClassList($array, '', 'goods.goods_name,goods.goods_id,goods.shop_goods_id', '', ' order by goods.goods_click desc', 8);
     $this->output('hot_array', $hot_array);
     /*浏览过的商品*/
     if ($this->getCookies('c_product_viewed') != '') {
         $view_goods_array = $this->obj_product_class->productClassList(array('c_product_viewed' => $this->getCookies('c_product_viewed')), '', 'goods.goods_name,goods.goods_id,goods.goods_small_image,shop_goods_id');
         $this->output('view_goods_array', $view_goods_array);
     }
     $this->showpage('product_class');
 }
开发者ID:jn7163,项目名称:ShopNC,代码行数:58,代码来源:product_class.php

示例2: product


//.........这里部分代码省略.........
         $product_array['more_image'] = $goods->getGoodsImage($product_array['goods_id']);
     }
     $this->output('more_image_num', count($product_array['more_image']) + 1);
     $this->output('product_array', $product_array);
     /*浏览量*/
     $goods_click = intval($product_array['goods_click']) + 1;
     $this->obj_goods->modifyGoods($goods_click, $condition['goods_id'], "goods_click");
     /*推荐产品*/
     $commend_array = $this->obj_product->getProductSpecific(array('goods_commend' => 1, 'goods_state' => 1));
     $this->output('commend_array', $commend_array);
     /*产品属性*/
     $goods_attr_body = @unserialize($product_array['goods_attr_body']);
     //商品内的属性
     include 'goodsClass.class.php';
     //载入产品分类文件
     $goods_class = new GoodsClassClass();
     $goods_type_id = $goods_class->getGoodsClassInfo(array('class_id' => $product_array['class_id']), 'goods_type_id,class_other_attr');
     if ($goods_type_id[0] != '') {
         include 'goodsType.class.php';
         $goods_type = new GoodsTypeClass();
         $type_array = $goods_type->getTypeInfo(array('goods_type_id' => $goods_type_id[0]));
         /*判断商品类型状态,如果关闭则不执行*/
         if ($type_array['goods_type_state'] == 1) {
             $attr_array = $goods_type->goodsAttrArray(array('txt_goods_type_id' => $type_array['goods_type_id']));
             $goods_attr = array();
             $i = 0;
             foreach ($attr_array as $val) {
                 if (!empty($goods_attr_body['class_attr'][$val['attribute_id']])) {
                     $goods_attr[$i]['title'] = $val['attribute_name'];
                     $goods_attr[$i]['vaule'] = $goods_attr_body['class_attr'][$val['attribute_id']];
                     $i++;
                 }
             }
             $this->output('goods_attr', $goods_attr);
         }
     }
     /*产品所在分类独有属性*/
     if (is_array($goods_type_id['class_other_attr']) and count($goods_type_id['class_other_attr']) > 0) {
         $goods_other_attr = array();
         foreach ($goods_type_id['class_other_attr'] as $key => $value) {
             if (!empty($goods_attr_body['class_other_attr'][$key])) {
                 $goods_other_attr[] = array('attr_name' => $value, 'attr_value' => $goods_attr_body['class_other_attr'][$key]);
             }
         }
     }
     $this->output('goods_other_attr', $goods_other_attr);
     /*相关商品*/
     if ($product_array['goods_link_goods'] != '') {
         if (intval($product_array['shop_goods_id']) == 0) {
             $goods_link_goods = $this->obj_goods->ajaxGoodsSearch(array('goods_id_str' => $product_array['goods_link_goods'], 'other_action' => 'modify_link'), '*');
         }
         $this->output('goods_link_goods', $goods_link_goods);
     }
     /*相关文章*/
     if ($product_array['goods_link_article'] != '') {
         include 'article.class.php';
         $article = new ArticleClass();
         $goods_link_article = $article->ajaxArticleSearch(array('article_id_str' => $product_array['goods_link_article'], 'other_action' => 'modify_link'));
         $this->output('goods_link_article', $goods_link_article);
     }
     /*产品导航条*/
     include BasePath . "/share/" . NC_SHOP_DIR . "goods_class_show.php";
     $array = array();
     foreach ($node_cache as $k => $v) {
         if ($v[0] == intval($product_array['class_id'])) {
             $array['class_id'] = $v[0];
             $array['class_top_id'] = $v[1];
             $array['key_id'] = $k;
             break;
         }
     }
     $class_menu = $this->obj_product_class->prductClassMenu($array);
     $this->output('class_menu', $class_menu);
     /*评论列表*/
     require_once "commonpage.class.php";
     $obj_page = new CommonPage();
     $obj_page->pagebarnum(10);
     $conditon_array = array('goods_id' => $condition['goods_id']);
     $comment_array = $this->obj_comment->getGoodsCommentList($conditon_array, $obj_page);
     $show_page = $obj_page->show(3);
     $this->output('comment_array', $comment_array);
     $this->output('show_page', $show_page);
     /*侧边商品分类显示*/
     $class_array = $goods_class->getClassSort();
     $this->output('class_array', $class_array);
     /*商品品牌*/
     $brand_array = $this->obj_brand->getBrandList(array('show_type' => 'class_show'));
     $this->output('brand_array', $brand_array);
     /*当前类热卖商品*/
     $hot_array = $this->obj_product_class->productClassList($array, '', 'goods.goods_name,goods.goods_id,goods.shop_goods_id', '', ' order by goods.goods_click desc', 8);
     $this->output('hot_array', $hot_array);
     /*浏览过的商品*/
     if ($this->getCookies('c_product_viewed') != '') {
         $view_goods_array = $this->obj_product_class->productClassList(array('c_product_viewed' => $this->getCookies('c_product_viewed')), '', 'goods.goods_name,goods.goods_id,goods.goods_small_image,shop_goods_id');
         $this->output('view_goods_array', $view_goods_array);
     }
     /*添加该商品到cookie,浏览商品*/
     $this->setReviewed(intval($this->_input['id']));
     $this->showpage("product");
 }
开发者ID:jn7163,项目名称:ShopNC,代码行数:101,代码来源:product.php


注:本文中的obj::prductClassMenu方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。