[共享]顾客自己在购物车选自己要的属性
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粘多了,麻烦你在帮我看下? 我那功能有点麻烦,我在整理,整理好了共享出来! |
顶一下,!!! |
要的人就帮忙啊! |
帮帮忙啊!大家互相帮助啊! |
最近更新
常用插件
- ecshop商品分类名称增加样
ecshop插件介绍:本插件可以方便在后台管理,为ecshop商品分类名称增加样...
- ecshop2.7.1打印发货单插件
ecshop2.7.1打印发货单插件介绍:ecshop2.7.1和以前的ecshop版本不一样,ecs...
- ecshop分类批量扩展插件
ecshop分类批量扩展插件,这个插件是ecshop插件里面比较核心的插件。我们...
- ecshop二次开发详细页面生
插件介绍: ECSHOP系统,在很多时候,很多商品没有人购买,不但购买的人...
- ecshop二次商品订购人信息
ecshop二次商品订购人信息填写插件,有时候给朋友送花,或者是送礼品的...
ecshop热门问答
ecshop热门资料
ecshopbatch
ecshopdoes
ecshop首页调用限时抢购
ecshop复元
ecshop备份
ecshop双模手机
ecshop限时
ecshop汇丰银行
ecshop跟踪
ecshopmtz
ecshop用户登录
ecshop商品包装
ecshopornaments
ecshop侵权
ecshop账号
ecshopQQ主页天气代码
ecshop白板
ecshop书店
ecshopConnect
ecshop代理
ecshop没有
ecshop俄罗斯
ecshop通栏广告
ecshopuser
ecshop平平商城
ecshop在一起
ecshop改进
ecshop提取分类
51ecshop
ecshop营销