用户名:
密码:
个人资料
新郸城网
博客访问:18018
会员积分:245
日志分类
查看日志
同城网购商城问题详解
分享到: 更多
编写语句在后台——商城频道——商城参数——组合语句(进入商城参数页面拖到页面最底部)
类别“手机数码”的编号为3
类别“手机数码”下的“手机配件”的编号为33
类别“手机数码”下的“手机配件”下有一个子级叫“蓝牙耳机”
 
比如要显示一级类别“手机数码”下的所有商品,语句为:
where enable=1 and (classid=30 or classid=31 or classid=32 or classid=33 or classid=34) and thumbnail<>'' order by time desc,id desc
 
比如要显示一级类别“手机数码”下“手机配件”下的所有商品,语句为:
where enable=1 and classid=33 and thumbnail<>'' order by time desc,id desc
 
比如要显示一级类别“手机数码”下“手机配件”下“蓝牙耳机”下的所有商品,语句为:
where enable=1 and classid=33 and sonclass ='(33)蓝牙耳机' and thumbnail<>'' order by time desc,id desc
 
———————————————————————————————————————————
 
比如一个会员发布商品,该会员的ID为27,要显示该会员发布的所有商品。
 
比如会员“苏宁电器”的会员ID为27,要在商城主页显示该会员的所有商品
 
比如名称写“苏宁电器专区”
语句为  where enable=1 and uid=27 and thumbnail<>'' order by time desc,id desc
 
———————————————————————————————————————————
 再来举个例子,比如建立一个版块放2元专区
名称写“2元专区”
则语句为 where enable=1 and buyprice=2 and thumbnail<>'' order by time desc,id desc
 
 
要显示价格在100元到500元之间的商品,
则语句为 where enable=1 and buyprice>=100 and buyprice<=500 and thumbnail<>'' order by time desc,id desc
 
商品的排序:
默认的排序是order by time desc,id desc (按最新发布的商品显示 )
 
按点击率由高到低order by click desc,time desc,id desc
按购买数由高到低order by buycount desc,time desc,id desc
显示推荐,优先显示推荐商品order by istop desc,isred desc,time desc,id desc
按价格排序,由低价到高价order by buyprice asc,time desc,id desc
按价格排序,由高价到低价order by buyprice desc,time desc,id desc
 
发表评论