'查询订单类型,团购或者普通 Dim RSItty:Set RSItty=Server.CreateObject("adodb.recordset") RSItty.Open"Select OrderType From KS_Order Where OrderID='" & RS("OrderID") & "'",Conn,1,1
'查询订单商品id号和数量 Dim RSIt:Set RSIt=Server.CreateObject("adodb.recordset") Dim sql sql="Select ProID,amount From KS_OrderItem Where SaleType<>5 and SaleType<>6 and OrderID='" & RS("OrderID") & "'" RSIt.OPEN sql,Conn,1,1 if RSIt.eof and RSIt.bof then else do while not RSIt.eof '循环出订单中所有商品,针对一次购买多种商品
'查询订单商品名称 Dim RSIts:Set RSIts=Server.CreateObject("adodb.recordset") If RSItty("OrderType")=1 Then RSIts.Open"Select Subject From ks_groupbuy Where ID="& RSIt("ProID")&"",Conn,1,1 producttitle=RSIts("Subject") ELSE RSIts.Open"Select Title From KS_Product Where ID="& RSIt("ProID")&"",Conn,1,1 producttitle=RSIts("Title") end if
'生成短信内容发送到客户手机 dim ReturnInfotel,i,Mobile if rs("phone")="" then Mobile=rs("Mobile") else Mobile=rs("phone") end if
for i=1 to RSit("amount") ReturnInfotel="尊敬的"&rs("username")&",您好,您购买的"&RSit("amount")&"件【"&producttitle&"】商品,订单号为:" & RS("OrderID") & ",我们已经发货,这是第"&i&"件,请注意查收!"&now call KSsms.sendsms(Mobile,ReturnInfotel) next '循环订单所有商品结束---------------------------------------------------------------------------- RSIt.movenext loop end if RSIt.close Set RSIt=Nothing