[共享]顾客自己在购物车选自己要的属性

2016-07-07 15:06 来源:www.chinab4c.com 作者:ecshop专家



拿可以在购物车更改属性的功能交换帮我把下面的两句SQL语句写成一条,qq:573299746
$sql = 'SELECT g.goods_id, g.goods_name,g.goods_sn,g.goods_weight, g.goods_name_style, g.market_price, g.is_new, g.is_best, g.is_hot, g.shop_price AS org_price, ' .
"IFNULL(mp.user_price, g.shop_price * '$_SESSION[discount]') AS shop_price, g.promote_price, g.goods_type, " .
'g.promote_start_date, g.promote_end_date, g.goods_brief, g.goods_thumb , g.goods_img ' .
'FROM ' . $GLOBALS['ecs']->table('goods') . ' AS g ' .
'LEFT JOIN ' . $GLOBALS['ecs']->table('member_price') . ' AS mp ' .
"ON mp.goods_id = g.goods_id AND mp.user_rank = '$_SESSION[user_rank]' " .
"WHERE $where $ext ORDER BY $sort $order";




$sql = 'SELECT a.attr_id, a.attr_name, a.is_linked, a.attr_type, g.goods_attr_id, g.attr_value, g.attr_price ' .
'FROM ' . $GLOBALS['ecs']->table('goods_attr') . ' AS g ' .
'LEFT JOIN ' . $GLOBALS['ecs']->table('attribute') . ' AS a ON a.attr_id = g.attr_id ' .
"WHERE g.goods_id = '$goods_id' " .
'ORDER BY a.sort_order, g.attr_price, g.goods_attr_id';

这两个语句怎么写成一句啊?第一次粘多了,现在改过来了,知道的说下吧!

回答:
没人知道吗?
自己顶下

怎么没人知道吗?

知道的大哥大姐说一下啊!!
版主帮帮忙啊!



有什么功能共享出来,红色合并的语法大概如下,没有测试。
$sql = 'SELECT g.goods_id, g.goods_name, g.goods_attr, g.goods_name_style, g.market_price, g.is_new, g.is_best, g.is_hot, g.shop_price AS org_price, ' .
"IFNULL(mp.user_price, g.shop_price * '$_SESSION[discount]') AS shop_price, g.promote_price, g.goods_type, " .
'g.promote_start_date, g.promote_end_date, g.goods_brief, g.goods_thumb , g.goods_img ' .
',a.attr_id, a.attr_name, a.is_linked, a.attr_type, ga.goods_attr_id, ga.attr_value, ga.attr_price'.
'FROM ' . $GLOBALS['ecs']->table('goods') . ' AS g ' .
'LEFT JOIN ' . $GLOBALS['ecs']->table('member_price') . ' AS mp ' .
"ON mp.goods_id = g.goods_id AND mp.user_rank = '$_SESSION[user_rank]' " .
'LEFT JOIN ' . $GLOBALS['ecs']->table('goods_attr') . ' AS ga ON g.goods_id = ga.goods_id' .
'LEFT JOIN ' . $GLOBALS['ecs']->table('attribute') . ' AS a ON a.attr_id = ga.attr_id' .

"WHERE $where $ext and ga.goods_id = '$goods_id'ORDER BY $sort $order";

上楼的不行啊,我是想在商品列表页调用,后台的自定义类型中的可选属性怎么弄啊!

我只给你合并SQL语句,具体的怎么显示,出什么样的结果我可管不着。



不好意思上楼的,第一句sql粘多了,麻烦你在帮我看下?

我那功能有点麻烦,我在整理,整理好了共享出来!

顶一下,!!!

要的人就帮忙啊!

帮帮忙啊!大家互相帮助啊!