/** * 搜索结果列表 * */ 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'); }