/** * 单一品牌商品列表 * */ private function showBrand() { $brand_id = intval($this->_input['brandid']); if ($brand_id == 0) { header("Location:?action=index"); exit; } /*品牌信息*/ $brand_info = $this->obj_brand->getBrandInfo(array('brand_id' => $brand_id)); $this->output('brand_info', $brand_info); /*创建分页对象*/ $view_list_num = $this->_viewinfo['websit']['other_brand_class'] == '1' ? (int) $this->_viewinfo['websit']['other_brand_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); $brand_product = $this->obj_brand->productBrandList(array('brand_id' => intval($this->_input['brandid'])), $obj_page, '*', $this->_input['goods_show']); $product_brand_page = $obj_page->show(6); $this->output('product_brand_page', $product_brand_page); $this->output('brand_product', $brand_product); /*该品牌热门商品*/ $hot_array = array(); $hot_array = array('brand_id' => intval($this->_input['brandid']), 'order_value' => 'goods_click', 'limit_num' => 8); $brand_hot = $this->obj_brand->getBrandProduct($hot_array); $this->output('brand_hot', $brand_hot); /*推荐品牌,暂时无此字段*/ $brand_commend = $this->obj_brand->getBrandList(array('show_type' => 'class_show')); $this->output('brand_commend', $brand_commend); $this->showpage('product_brand_list'); }
/** * @param string $caption * @param string $contentEncoding * @param string $message * @param string $description * @param Page $parentPage */ public function __construct($caption, $contentEncoding, $message, $description, $parentPage) { parent::__construct($caption, $contentEncoding); $this->parentPage = $parentPage; $this->message = $message; $this->description = $description; }
public static function createForPage(CommonPage $page) { $currentPageFilename = $page->GetPageFileName(); $pageList = new PageList($page); $pageGroups = GetPageGroups(); foreach ($pageGroups as $group) { $pageList->AddGroup($page->RenderText($group)); } $pageInfos = GetPageInfos(); foreach ($pageInfos as $pageInfo) { if (!GetCurrentUserGrantForDataSource($pageInfo['name'])->HasViewGrant()) { continue; } $shortCaption = $page->RenderText($pageInfo['short_caption']); $pageList->AddPage(new PageLink($page->RenderText($pageInfo['caption']), $pageInfo['filename'], $shortCaption, $currentPageFilename == $pageInfo['filename'], $pageInfo['add_separator'], $page->RenderText($pageInfo['group_name']))); } return $pageList; }
/** * 文章内容分类列表 * */ private function articleList() { $condition['article_class_id'] = intval($this->_input['id']); /*侧边文章分类*/ $class_array = $this->obj_show_class->getClass(array('article_class_topid' => $condition['article_class_id'])); $this->output('class_array', $class_array); /*创建分页对象*/ require_once "commonpage.class.php"; $obj_page = new CommonPage(); $obj_page->pagebarnum(12); $article_array = $this->obj_show_article->getArticleList($condition, $obj_page, array('article_commend desc,article_sort')); $show_page = $obj_page->show(6); $this->output('article_array', $article_array); $this->output('show_page', $show_page); /*当前分类信息*/ $class_info = $this->obj_show_class->getArticleClass(array('article_class_id' => intval($this->_input['id']))); $article_class['title'] = $class_info[0]['article_class_name']; $article_class['keywords'] = $class_info[0]['article_class_keywords']; $article_class['description'] = $class_info[0]['article_class_description']; $this->output('article_class', $article_class); $this->showpage('article_list'); }
/** * 分类下的商店列表 * */ private function showSearchShopList() { $condition_array = array(); if (intval($this->_input['txt_class_top_id']) != 0) { //店铺分类 $tid = intval($this->_input['txt_class_top_id']); } if (trim($this->_input['txt_keywords']) != '') { //关键字 $condition_array['shopname'] = trim($this->_input['txt_keywords']); } if (trim($this->_input['txtProvince']) != '') { //商品在地 $condition_array['txt_address'] = trim($this->_input['txtProvince']); } $condition_array['shopstate'] = 1; //状态 /*得到网店类别信息*/ if ($tid != '') { $class_info = $this->obj_shop_class->getShopClassInfo(array('class_id' => $tid)); $this->output('class_info', $class_info); } if ($tid != '') { /*查找下一级分类*/ include BasePath . "/share/shop_class_show.php"; $node_str = ""; foreach ($node_cache as $node) { if ($node['parentId'] == $tid and $node['iffb'] == 1) { $node_str .= $node['id'] . ","; } } $node_str .= $tid; $condition_array['class_id_str'] = trim($node_str, ','); } /*创建分页对象*/ require_once "commonpage.class.php"; $obj_page = new CommonPage(); $obj_page->pagebarnum(10); $obj_page->pagesize = 3; $shop_array = $this->obj_shopuser->getShopList($condition_array, $obj_page); /*取得店铺发布商品数量*/ $shop_id_str = ''; foreach ($shop_array as $v) { $shop_id_str .= $v['userid'] . ','; } if ($shop_id_str != '') { $shop_id_str = trim($shop_id_str, ','); $shop_array_count = $this->obj_shopuser->getShopGoodsCount($shop_id_str); foreach ($shop_array as $k => $v) { foreach ($shop_array_count as $v1) { if ($v['userid'] == $v1['shop_id']) { $shop_array[$k]['goods_count'] = $v1['goods_count']; } } } } $show_page = $obj_page->show(8); $this->output('shop_array', $shop_array); $this->output('shop_count', count($shop_array)); $this->output('page_list', $show_page); /*新开网店*/ $new_shops_array = $this->obj_shopuser->getShopListType(array('shop_type' => 'new_shop'), 6); $this->output('new_shops_array', $new_shops_array); $this->output('query_string', $_SERVER["QUERY_STRING"]); $this->shopshowpage("shop_search_list"); }
/** * 产品显示页面 * */ private function product() { require_once "shopGoods.class.php"; $obj_shop_goods = new ShopGoodsClass(); /*当前产品信息*/ $condition['goods_id'] = intval($this->_input['id']); if ($condition['goods_id'] == 0) { header("Location:index.php"); exit; } $condition['no_state'] = 1; $product_array = $this->obj_product->getProductInfo($condition); /*产品颜色,产品规格*/ $c_array = @explode('|', $product_array['goods_color']); $s_array = @explode('|', $product_array['goods_size']); $color_select = $product_array['goods_color'] != '' ? Common::Select('goods_color', array_combine($c_array, $c_array)) : ''; $size_select = $product_array['goods_size'] != '' ? Common::Select('goods_size', array_combine($s_array, $s_array)) : ''; $this->output('color_select', $color_select); //颜色输出 $this->output('size_select', $size_select); //规格输出 /*产品多图*/ require_once 'goods.class.php'; $goods = new GoodsClass(); if ($product_array['shop_goods_id'] != '') { $product_array['more_image'] = $goods->getGoodsImage($product_array['shop_goods_id']); } else { $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"); }
public function __construct() { parent::__construct('Login', 'UTF-8'); $this->OnGetCustomTemplate = new Event(); }
/** * 商品搜索结果列表 * */ private function productSearchList() { $input_param = array(); $input_param['txt_start_price'] = intval($this->_input['txt_start_price']); //开始价格 $input_param['txt_end_price'] = intval($this->_input['txt_end_price']); //结束价格 $input_param['txt_class_top_id'] = intval($this->_input['txt_class_top_id']); //店铺分类 $input_param['txt_address'] = trim($this->_input['txtProvince']); //商品在地 $input_param['state'] = 1; //发布状态 $input_param['shop_goods_state'] = 1; /*店铺下拉列表*/ include BasePath . "/share/shop_class_show.php"; $parent_array = array(); foreach ($node_cache as $node) { if ($node['parentId'] == 0 && $node['iffb'] == 1) { $parent_array[] = $node; } } $i = 0; $node_array = array(); foreach ($parent_array as $parent) { $node_array[$i] = $parent; foreach ($node_cache as $node) { if ($parent['id'] == $node['parentId'] && $node['iffb'] == 1) { $node_array[$i]['sub_array'][] = $node; } } $i++; } $this->output('node_array', $node_array); /*热门店铺*/ $hot_shops_array = $this->obj_shop_user->getShopListType(array('shop_type' => 'hot_shop'), 5); $this->output('hot_shops_array', $hot_shops_array); require_once "commonpage.class.php"; $obj_page = new CommonPage(); if (in_array($this->_input['num'], array(12, 24, 36))) { $obj_page->pagebarnum(intval($this->_input['num'])); //每页显示商品数 } else { $obj_page->pagebarnum(12); //每页显示商品数 } $obj_page->pagesize = 3; if ($this->_configinfo['websit']['pay_receive_type'] == 1) { //搜索子店发布的商品 $input_param['goods_name'] = trim($this->_input['txt_keywords']); //关键字 if ($this->_input['sort'] == 'pricedesc') { $order_array = array('goods_pricedesc desc', ''); } else { $order_array = array('goods_pricedesc', ''); } $search_array = $this->obj_product->searchShopGoods($input_param, $obj_page, '*'); } else { //搜索子店领取的主店商品 if ($this->_input['sort'] == 'pricedesc') { $order_array = array('', 'goods_pricedesc desc'); } else { $order_array = array('', 'goods_pricedesc'); } $input_param['shop_goods_name'] = trim($this->_input['txt_keywords']); //关键字 $search_array = $this->obj_goods->getChooseGoodsList($input_param, $obj_page, $order_array); } $search_page = $obj_page->show(8); $this->output('search_count', $obj_page->total_num); $this->output('product_class_page', $search_page); $this->output('product_array', $search_array); $this->output('query_string', $_SERVER["QUERY_STRING"]); $this->shopshowpage("product_search_list"); }
/** * 文章列表 * */ private function showArticleList() { /*右侧文章列表*/ include "shopArticleClass.class.php"; $article_class = new ShopArticleClassClass(); $class_array = $article_class->getArticleClassList(); $article_array = $this->obj_article->getArticleList('', ''); foreach ($class_array as $k => $v) { foreach ($article_array as $v1) { if ($v['cid'] == $v1['arc_class']) { if (count($class_array[$k]['body']) < 5) { $class_array[$k]['body'][] = $v1; } } } } $this->output('artclass_array', $class_array); /*创建分页对象*/ require_once "commonpage.class.php"; $obj_page = new CommonPage(); $obj_page->pagebarnum(10); $obj_page->pagesize = 3; $condition_array = array('article_state' => 1); $condition_array = array('arc_class' => intval($this->_input['id'])); $article_array = $this->obj_article->getArticleList($condition_array, $obj_page); $show_page = $obj_page->show(8); $this->output('article_array', $article_array); $this->output('show_page', $show_page); /*热门店铺*/ $hot_shops_array = $this->obj_shopuser->getShopListType(array('shop_type' => 'hot_shop'), 5); $this->output('hot_shops_array', $hot_shops_array); $this->shopshowpage("article_list"); }
public function __construct($tableBasedGrantsManager) { parent::__construct($this->GetCaption(), 'UTF-8'); $this->tableBasedGrantsManager = $tableBasedGrantsManager; $this->OnGetCustomTemplate = new Event(); }
/** * 搜索结果列表 * */ private function SearchList() { $input_param = array(); $input_param['keywords'] = trim($this->_input['keywords']); //关键字 $input_param['start_price'] = intval($this->_input['start_price']); //开始价格 $input_param['end_price'] = intval($this->_input['end_price']); //结束价格 $input_param['all_sun'] = trim($this->_input['all_sun']); //选择全部子类 $input_param['sel_goods_class'] = intval($this->_input['sel_goods_class']); //商品分类 $input_param['sel_goods_brand'] = intval($this->_input['sel_goods_brand']); //商品品牌 $sql = ''; if ($input_param['start_price'] != 0 and $input_param['end_price'] != 0) { $sql .= " and (goods.goods_pricedesc <=" . $input_param['end_price'] . " and goods.goods_pricedesc >=" . $input_param['start_price'] . ")"; } if ($input_param['sel_goods_brand'] != 0) { $sql .= " and goods.brand_id=" . $input_param['sel_goods_brand']; } require_once "commonpage.class.php"; $obj_page = new CommonPage(); $obj_page->pagebarnum(20); //每页显示商品数 include BasePath . "/share/" . NC_SHOP_DIR . "goods_class_show.php"; $array = array(); $i = 0; foreach ($node_cache as $k => $v) { if ($v[1] == 0) { $left_array[$i]['class_id'] = $v[0]; $left_array[$i]['class_name'] = $v[2]; $i++; } if ($input_param['all_sun'] == 'all_sun') { if ($v[0] == $input_param['sel_goods_class']) { $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; $input_param['sub_class1'] = $array; } } } $this->output('left_array', $left_array); //左侧商品分类 if ($this->_configinfo['websit']['pay_receive_type'] == 1) { //搜索子店发布的商品 $search_array = $this->obj_product->searchGoods($input_param, $obj_page, '*', '', $sql); } else { require_once 'goods.class.php'; $obj_goods = new GoodsClass(); //$input_param['nc_shop_id'] = NC_SHOP_ID; $input_param['shop_goods_name'] = trim($this->_input['keywords']); //关键字 $search_array = $obj_goods->getChooseGoodsList($input_param, $obj_page); } $search_page = $obj_page->show(6); $this->output('search_count', $obj_page->total_num); $this->output('product_class_page', $search_page); $this->output('product_array', $search_array); /*商品品牌*/ $brand_array = $this->obj_goods_brand->getBrandList(array('show_type' => 'class_show')); $this->output('brand_array', $brand_array); $this->showpage('search_list'); }
/** * 其他显示方式 * */ private function showOtherClass() { if (!in_array(trim($this->_input['type']), array('hot', 'new', 'commend', 'special'))) { return false; } /*分类导航*/ $language = 'product_class_' . trim($this->_input['type']); $class_menu[] = array('class_id' => 0, 'class_name' => $this->_lang[$language]); $this->output('class_menu', $class_menu); /*创建分页对象*/ $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']); } $condition = array(); $condition = array('show_type' => 'other', 'type' => trim($this->_input['type'])); require_once "commonpage.class.php"; $obj_page = new CommonPage(); $obj_page->pagebarnum($view_list_num); $product_array = $this->obj_product_class->productClassList($condition, $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'); }