| | |
| | | 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
|
| | |
| | | ADUser="155"
|
| | | ElseIf UserSourceSP(i)="Iid166" Then
|
| | | ADUser="166"
|
| | | ElseIf UserSourceSP(i)="Iid193" Then
|
| | | ADUser="193"
|
| | | End If
|
| | | End If
|
| | | Next
|
| | |
| | | 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
|
| | |
| | | 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
|
| | |
| | |
|
| | | }
|
| | | function sendPayUrl($phone,$name,$payurl){
|
| | | $payurl="wx.966120.com.cn/?n=".$payurl;
|
| | | $content='【广东民航医疗】移动支付指引:'.$name.'您好!请点击以下链接进入信息确认和支付界面。核对您的出车信息无误后,可选择支付宝或者微信支付:' .$payurl;
|
| | | $paycode=$payurl;
|
| | | $payurl="wx.966120.com.cn";
|
| | | $content='【广东民航医疗】移动支付指引:'.$name.'您好!请点击以下链接进入信息确认和支付界面。核对您的出车信息无误后,可选择支付宝或者微信支付:' .$payurl.' 登录码:'.$paycode;
|
| | | // echo $content;
|
| | | require './sms/SmsSend.php';
|
| | | $sms = new SmsSend('gdmhhy', 'lLsZyz3YVYKQ');
|
| | |
| | | // print_r($result);
|
| | | return $result;
|
| | |
|
| | | }
|
| | | function sendValidate($phone,$code){
|
| | | $content='【广东民航医疗】验证码:'.$code.',您正在登录,若非本人操作,请勿泄露.';
|
| | | require './sms/SmsSend.php';
|
| | | $sms = new SmsSend('gdmhhy', 'lLsZyz3YVYKQ');
|
| | | $result = $sms->sendSmsOne([['phone' => $phone, 'content' => $content]], '');
|
| | | return $result;
|
| | | }
|
| | | function sendCallCar($phone,$UserName,$CarLicense){
|
| | | $content='【广东民航医疗】您预订的救护车已经出发。负责人'.$UserName.',车牌'.$CarLicense.'。请您留意并提防假冒。欢迎关注“966120民航医疗快线”微信服务号,可查看本趟转运信息,并分享车辆的实时位置给亲友。';
|
| | | require './sms/SmsSend.php';
|
| | | $sms = new SmsSend('gdmhhy', 'lLsZyz3YVYKQ');
|
| | | $result = $sms->sendSmsOne([['phone' => $phone, 'content' => $content]], '');
|
| | | return $result;
|
| | | }
|
| | | function sendPayOK($phone,$name,$m1,$d1,$m2){
|
| | | $content='【广东民航医疗】'.$name.'您好!您已支付了定金'.$m1.'元,我们的服务团队到达出发地'.$d1.'后,将收齐余下'.$m2.'元后再出发。如需发票,请关注“966120民航医疗快线”,任务结束后在“我的”--“发票申请”处申请。如服务团队已经出车,该定金无法退回,请知悉。有疑问欢迎随时拨打服务热线 (020) 966120,谢谢!';
|
| | | require './sms/SmsSend.php';
|
| | | $sms = new SmsSend('gdmhhy', 'lLsZyz3YVYKQ');
|
| | | $result = $sms->sendSmsOne([['phone' => $phone, 'content' => $content]], '');
|
| | | return $result;
|
| | | }
|
| | | // 调用示例:
|
| | | set_time_limit(0);
|
| | |
| | | //支付指引
|
| | | $name=empty($_REQUEST['name'])!=false ? "" : addslashes($_REQUEST['name']); //内容--姓名
|
| | | $payurl=empty($_REQUEST['payurl'])!=false ? "" : addslashes($_REQUEST['payurl']); //内容--短链接验证码
|
| | | $codejson=json_encode(array("name"=>$name,"payurl"=>$payurl), JSON_UNESCAPED_UNICODE);
|
| | | // $codejson=json_encode(array("name"=>$name,"payurl"=>$payurl), JSON_UNESCAPED_UNICODE);
|
| | | $result=sendPayUrl($Phone,$name,$payurl);
|
| | | echo json_encode($result);
|
| | | return;
|
| | |
| | | //出车短信
|
| | | $UserName=empty($_REQUEST['UserName'])!=false ? "" : addslashes($_REQUEST['UserName']); //内容--负责人
|
| | | $CarLicense=empty($_REQUEST['CarLicense'])!=false ? "" : addslashes($_REQUEST['CarLicense']); //内容--车牌
|
| | | $codejson=json_encode(array("UserName"=>$UserName,"CarLicense"=>$CarLicense), JSON_UNESCAPED_UNICODE);
|
| | | // $codejson=json_encode(array("UserName"=>$UserName,"CarLicense"=>$CarLicense), JSON_UNESCAPED_UNICODE);
|
| | | $result=sendCallCar($Phone,$UserName,$CarLicense);
|
| | | echo json_encode($result);
|
| | | return;
|
| | | }elseif ($lateCode=="SMS_219737201") {
|
| | | //评价短信
|
| | | $payurl=empty($_REQUEST['payurl'])!=false ? "" : addslashes($_REQUEST['payurl']); //内容--短链接验证码
|
| | |
| | | $m1=empty($_REQUEST['m1'])!=false ? "" : addslashes($_REQUEST['m1']); //内容--收到定金
|
| | | $m2=empty($_REQUEST['m2'])!=false ? "" : addslashes($_REQUEST['m2']); //内容--收齐余下金额
|
| | | $d1=empty($_REQUEST['d1'])!=false ? "" : addslashes($_REQUEST['d1']); //内容--出发地
|
| | | $codejson=json_encode(array("name"=>$name,"m1"=>$m1,"m2"=>$m2,"d1"=>$d1), JSON_UNESCAPED_UNICODE);
|
| | | // $codejson=json_encode(array("name"=>$name,"m1"=>$m1,"m2"=>$m2,"d1"=>$d1), JSON_UNESCAPED_UNICODE);
|
| | | $result=sendPayOK($Phone,$name,$m1,$d1,$m2);
|
| | | echo json_encode($result);
|
| | | return;
|
| | | }elseif ($code!=''){
|
| | | //发送验证码
|
| | | $codejson=json_encode(array("code"=>$code), JSON_UNESCAPED_UNICODE);
|
| | | // $codejson=json_encode(array("code"=>$code), JSON_UNESCAPED_UNICODE);
|
| | | $result=sendValidate($Phone,$code);
|
| | | echo json_encode($result);
|
| | | return;
|
| | | }
|
| | | if ($Phone!='' and $codejson!='' and $lateCode!='') {
|
| | | $response = SmsDemo::sendSms($Phone,$codejson,$lateCode,$SignName);
|
| | |
| | |
|
| | | If StartAddress_lat=0 And errcode=0 Then
|
| | | appUrl="https://api.map.baidu.com/geocoding/v3/"
|
| | | args1="address="&StartAddress&"&output=json&ak=rGQBbHKGjAtVQy23OckafQkC6nNlaGmi"
|
| | | args1="address="&StartAddress&"&output=json&ak=itVkbEKpECSqWgP9u8Po7ZiBkUHR9p2p"
|
| | | HTMLCODE= GetBody(appUrl,args1)
|
| | | 'Response.Write HTMLCODE
|
| | | 'Response.End
|
| | |
| | | End If
|
| | | If EndAddress_lat=0 And errcode=0 Then
|
| | | appUrl="https://api.map.baidu.com/geocoding/v3/"
|
| | | args1="address="&EndAddress&"&output=json&ak=rGQBbHKGjAtVQy23OckafQkC6nNlaGmi"
|
| | | args1="address="&EndAddress&"&output=json&ak=itVkbEKpECSqWgP9u8Po7ZiBkUHR9p2p"
|
| | | HTMLCODE= GetBody(appUrl,args1)
|
| | | 'Response.Write HTMLCODE
|
| | | 'Response.End
|
| | |
| | |
|
| | | '地区报价方案
|
| | | appUrl="https://api.map.baidu.com/reverse_geocoding/v3/"
|
| | | args1="location="&Region_lat&","&Region_lng&"&output=json&latest_admin=1&ak=rGQBbHKGjAtVQy23OckafQkC6nNlaGmi"
|
| | | args1="coordtype=gcj02ll&location="&Region_lat&","&Region_lng&"&output=json&latest_admin=1&ak=itVkbEKpECSqWgP9u8Po7ZiBkUHR9p2p"
|
| | | HTMLCODE= GetBody(appUrl,args1)
|
| | | json = HTMLCODE
|
| | | 'Response.Write HTMLCODE
|
| | |
| | | If TraDistance=0 Then
|
| | | '路线规划距离(公里)
|
| | | appUrl="https://api.map.baidu.com/directionlite/v1/driving"
|
| | | args1="origin="&StartAddress_lat&","&StartAddress_lng&"&destination="&EndAddress_lat&","&EndAddress_lng&"&coord_type=wgs84&ak=rGQBbHKGjAtVQy23OckafQkC6nNlaGmi"
|
| | | args1="origin="&StartAddress_lat&","&StartAddress_lng&"&destination="&EndAddress_lat&","&EndAddress_lng&"&coord_type=wgs84&ak=itVkbEKpECSqWgP9u8Po7ZiBkUHR9p2p"
|
| | | HTMLCODE= GetBody(appUrl,args1)
|
| | | json = HTMLCODE
|
| | |
|
| | |
| | | OrderPriceFRM = OrderPriceFRM & "+"&WaitingInt&"*"&IRWaitingCost
|
| | | OrderPriceTXT = OrderPriceTXT&"等待费用:"&WaitingInt*IRWaitingCost&"元\n"
|
| | | End If
|
| | | If ServiceOrdApptDate<>"" Then '非工作时间服务费用20250812,周一~周五晚上21点30分后至早上7点整前为1.3倍
|
| | | If ServiceOrdApptDate<>"" Then '非工作时间服务费用20250624,周一~周五晚上22点后至早上7点整前为1.3倍
|
| | | sql="select SpecialRatio from SpecialDates where SpecialDates='"&formatdatetime(ServiceOrdApptDate,2)&"'"
|
| | | rs.open sql,objConn,1,1
|
| | | if not rs.Eof Then
|
| | |
| | | OrderPriceFRM = OrderPriceFRM & OrderPrice*(SpecialRatio-1)
|
| | | OrderPriceTXT = OrderPriceTXT&"节假日时间服务费用:"&OrderPrice*(SpecialRatio-1)&"元\n"
|
| | | OrderPrice=OrderPrice*SpecialRatio
|
| | | ElseIf (hour(ServiceOrdApptDate)>=21 And minute(ServiceOrdApptDate)>=30) Or hour(ServiceOrdApptDate)<7 Then
|
| | | ElseIf (hour(ServiceOrdApptDate)>=22 Or hour(ServiceOrdApptDate)<7) Then
|
| | | OrderPriceFRM = OrderPriceFRM & OrderPrice*0.3
|
| | | OrderPriceTXT = OrderPriceTXT&"非工作时间服务费用:"&OrderPrice*0.3&"元\n"
|
| | | OrderPrice=OrderPrice*1.3
|