【调度系统】广东民航医疗快线调度系统源代码
wlzboy
2025-09-06 2decf5219e3476e30095fd9dbf6e49c55e105563
feat: 增加公交广告中的优惠券功能
1个文件已修改
30 ■■■■■ 已修改文件
API/User/index.gds 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
API/User/index.gds
@@ -85,6 +85,16 @@
End If
'签名验证---end
Function saveCoupon(objConn,Money,UserID,Remarks,Name)
    CouponNO=DTimeID()&getIDnumbers(6)
    CouponMoney=Money
    CouponRemarks=Remarks
    CouponName=Name
    If UserID="" Then UserID=0
    sql="Insert into Coupon (CouponNO,CouponName,CouponMoney,CouponDate_Ent,CouponRemarks,ServiceOrdIDPK,ToUserID) values ('"&CouponNO&"','"&CouponName&"',"&CouponMoney&",getdate()+365*2,'"&CouponRemarks&"',0,"&UserID&")"
    objConn.Execute sql
End Function
objConn.BeginTrans
If errcode="" then
@@ -163,6 +173,8 @@
                        ADUser="155"
                    ElseIf UserSourceSP(i)="Iid166" Then
                        ADUser="166"
                    ElseIf  UserSourceSP(i)="Iid193" Then
                        ADUser="193"
                    End If
                End If
            Next
@@ -427,7 +439,21 @@
                NewUserCoupon=0
            End If
            
            If (ADUser="153") And NewUser=1 And DateDiff("d",now(),"2023-9-15")<=0 And DateDiff("d",now(),"2024-6-30")>=0 Then
            if (ADUser="193")  And DateDiff("d",now(),"2025-9-5")<=0 And DateDiff("d",now(),"2028-1-1")>=0 Then
                sql="select * from Coupon where CouponDate_Ent>=getdate() and CouponName like '城市服务 优惠%' and ToUserID="&UserID
                rs.open Sql,objConn,1,1
                If rs.Eof then
                    '公交车广告优惠
                    '城市服务优惠 发优惠券: 市内50 省内200 省外500 高铁1000 航空3000
                    saveCoupon objConn,50,UserID,"","城市服务 优惠 50元代金券-(本市行政区域内救护车转运可使用)"
                    saveCoupon objConn,50,UserID,"","城市服务 优惠 50元代金券-(本市行政区域内救护车转运可使用)"
                    saveCoupon objConn,200,UserID,"","城市服务 优惠 200元代金券-(单程距离100公里以上救护车转运可使用)"
                    saveCoupon objConn,500,UserID,"","城市服务 优惠 500元代金券-(单程距离500公里以上救护车转运可使用)"
                    saveCoupon objConn,1000,UserID,"","城市服务 优惠 1000元代金券-(高铁医疗转运可使用)"
                    saveCoupon objConn,3000,UserID,"","城市服务 优惠 3000元代金券-(航空医疗转运可使用)"
                End if
                rs.close()
            ElseIf (ADUser="153") And NewUser=1 And DateDiff("d",now(),"2023-9-15")<=0 And DateDiff("d",now(),"2024-6-30")>=0 Then
                sql="select * from Coupon where CouponDate_Ent>=getdate() and CouponName like '城市服务优惠%' and ToUserID="&UserID
                rs.open Sql,objConn,1,1
                If rs.Eof then
@@ -934,6 +960,8 @@
                webJson="""UserInformation"":{""Title"":""用户优惠券"",""Content"":"""",""PicUrl"":""https://api.966120.com.cn/OA_img/20231013160503.png"",""Url"":""/pages/my/login/login"",""OpenType"":""navigateTo""}"
            ElseIf UserID<>"0" And FormIDInt=0 And (InStr(pages,"148")>0 Or InStr(pages,"155")>0 Or InStr(CouponNames,"代金券")>0) Then
                webJson="""UserInformation"":{""Title"":""用户优惠券"",""Content"":"""",""PicUrl"":""https://api.966120.com.cn/OA_img/ad_20230727.png"",""Url"":"""",""OpenType"":""""}"
            ElseIf wxOpenid<>"" and FormIDInt=0 and (InStr(pages,"193")>0 or InStr(CouponNames,"代金券")>0) then
                webJson="""UserInformation"":{""Title"":""用户优惠券"",""Content"":""&pages&"",""PicUrl"":""https://api.966120.com.cn/OA_img/ad_0904.png"",""Url"":"""",""OpenType"":""""}"
            Else
                webJson="""UserInformation"":0"
            End If