您当前的位置:首页 > CMS常见问题 > ecshop常见问题 >

列出指定商品分类扩展分类下所有商品的商品类型属性值信息

0
select 
	g.goods_id,
	g.goods_name,
	g.cat_id,
	a.attr_id,
	a.attr_name,
	ga.attr_value,
	ga.attr_price
from ecs_goods as g, ecs_attribute as a, ecs_goods_attr as ga 
where (g.cat_id in ('1') or g.goods_id in ('')) 
and g.goods_id = ga.goods_id 
and a.attr_id = ga.attr_id 
and g.is_delete = 0 
and g.is_on_sale = 1 
and g.is_alone_sale = 1 
order by g.goods_id desc,
	 a.attr_id asc,
	 ga.goods_attr_id asc;

sql查询结果

select 
    	g.goods_id,
    	g.goods_name,
    	g.cat_id,
    	a.attr_id,
    	a.attr_name,
    	ga.attr_value,
    	ga.attr_price
    from ecs_goods as g, ecs_attribute as a, ecs_goods_attr as ga 
    where (g.cat_id in ('1') or g.goods_id in ('')) 
    and g.goods_id = ga.goods_id 
    and a.attr_id = ga.attr_id 
    and a.attr_id = 221 
    and g.is_delete = 0 
    and g.is_on_sale = 1 
    and g.is_alone_sale = 1 
    order by g.goods_id desc,
    	 a.attr_id asc,
    	 ga.goods_attr_id asc;

建站咨询

在线咨询真诚为您提供专业解答服务

咨询热线

137 1731 25507×24小时服务热线

微信交流

二维码终于等到你,还好我没放弃
返回顶部