最近用ecshop的数据库做一个商城系统,在筛选物品的时候遇到了问题.
数据库结构如下:
ecs_attribute 商品类型属性表,该表记录的 是每个商品类型的所有属性的配置情attr_id smallint自增ID号
cat_id smallint商品类型,同ecs__type的cat_id
attr_name varchar属性名称
attr_group tinyint属性分组,相同的为一个属性组。 该值应该取自ecs_goods_type的attr_group的值的顺序ecs_goods_attr 具体商品的属性表
goods_attr_id int自增ID号
goods_id mediumint该具体属性属于的商品,取值于ecs_goods的goods_id
attr_id smallint该具体属性属于的属性类型的id,取自ecs_attribute 的attr_id
attr_value text该具体属性的值用的MVC2+Nhibernate开发
我现在是通过筛选 ecs_goods_attr中的attr_value来筛选.
但是如何在URL中传参呢?比如用户已经选择筛选了一个属性,那么又要筛选一个,如何做到...
我看了下京东的URL删选,比如:http://www.360buy.com/products/670-699-700-0-0-0-2162-0-0-0-1-1-1.html
这样的URL是预先设置了属性个数?每个0都是筛选的预存值?我路由表这样写的:routes.MapRoute(
"GoodsFilter",
"{controller}/{action}/{id}/{attrValue}-{pageIndex}",
new { controller = "Category", action = "Filter", id = "", attrValue = "", pageIndex = "" }
);
数据库结构如下:
ecs_attribute 商品类型属性表,该表记录的 是每个商品类型的所有属性的配置情attr_id smallint自增ID号
cat_id smallint商品类型,同ecs__type的cat_id
attr_name varchar属性名称
attr_group tinyint属性分组,相同的为一个属性组。 该值应该取自ecs_goods_type的attr_group的值的顺序ecs_goods_attr 具体商品的属性表
goods_attr_id int自增ID号
goods_id mediumint该具体属性属于的商品,取值于ecs_goods的goods_id
attr_id smallint该具体属性属于的属性类型的id,取自ecs_attribute 的attr_id
attr_value text该具体属性的值用的MVC2+Nhibernate开发
我现在是通过筛选 ecs_goods_attr中的attr_value来筛选.
但是如何在URL中传参呢?比如用户已经选择筛选了一个属性,那么又要筛选一个,如何做到...
我看了下京东的URL删选,比如:http://www.360buy.com/products/670-699-700-0-0-0-2162-0-0-0-1-1-1.html
这样的URL是预先设置了属性个数?每个0都是筛选的预存值?我路由表这样写的:routes.MapRoute(
"GoodsFilter",
"{controller}/{action}/{id}/{attrValue}-{pageIndex}",
new { controller = "Category", action = "Filter", id = "", attrValue = "", pageIndex = "" }
);
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货