该SQL标签测试环境X1,X1版本对该SQL语句验证上有个BUG,可临时这样修复下:
\Admin\Include\LabelSQL.asp function ClearParam(byval SqlStr)函数
把下面代码注释下 1068行:
- if instr(SqlStr,"where")<>0 then sqlstr=split(SqlStr,"where")(0)
SQL标签名:分类商品SQL语句(S elect去掉空格):- S elect Top 10 ID,Title,photourl,hits,price_member,price,cmtnum From KS_Product P LEFT JOIN (S elect infoid,Count(*) As cmtnum From KS_Comment Where Channelid=5 Group By infoid) C ON P.ID=C.infoid Where verific=1 And Inputer='{$GetUserName}' And Tid In(S elect ID From KS_Class Where TS Like '%{$Param(0)}%') Order By hits Desc,ID Desc
循环体(简单参考):- [loop=10] <li> <a href="{$Field(id,GetInfoUrl,5,1)}" target="_blank"> <img width="190" height="190" src="{$Field(photourl,Text,0,0,2,)}"> <p class="statis">点击: <font>{$Field(hits,Num,0,2)}</font> | <span>评论:{$Field(cmtnum,Text,0,0,2,0)} </span></p> <p class="name">{$Field(title,Text,30,0,2,)}</p> <p class="price"><strong>¥</strong><span>{$Field(price_member,Num,1,2)}</span> / <del>{$Field(price,Num,1,2)}</del></p> </a></li>[/loop]
效果:
标签放置:空间模板里
20143941144542换成调用对应栏目ID即可
TIPS:此类标签效率不高,不建议多放