fetch1("select * from {$dbtbpre}enewsshopdd where ddid='$ddid' and haveprice=0 limit 1"); if(!$dd[ddid]){ printerror("未查询到该未付款订单!","history.go(-1)",1,0,1); } $payr=$empire->fetch1("select * from {$dbtbpre}enewspayapi where paytype='pcweixin' and isclose=0 limit 1"); if(!$payr[payid]) { printerror('请选择支付平台','',1,0,1); } $ddr=PayApiShopDdMoney($ddid); $money=$ddr['tmoney']; $tag=$public_r[sitename]."商品支付"; //商品描述 $body='订单:'.$dd[ddno].' 支付'; //商品详情 $detail='收货人姓名:'.$dd[truename].' 收货人地址:'.$dd[address]; $ddno=$dd[ddno]; } elseif($phome=='PayToFen'||$phome=='PayToMoney' || $phome=='BuyGroupPay'){ $tag="会员充值"; //描述 $body=$productname; //详情 $detail=$productname; $dotime=time(); $ddno=$dotime; if($phome=='BuyGroupPay'){ $ddno=$dotime; } $r=$empire->fetch1("select * from {$dbtbpre}ecmsshop_paylist where phome='$phome' and userid='$user[userid]' and ddno='$ddno' limit 1"); if(!$r[id]){ $empire->query("insert into {$dbtbpre}ecmsshop_paylist(userid,username,phome,ddno,zt,money,beizhu,paytype,dotime) values('$user[userid]','$user[username]','$phome','$ddno','0','$money','$productname','pcweixin','$dotime')"); } } //------------------ 参数结束 ------------------ $input->SetBody($body); $input->SetAttach($detail); $input->SetOut_trade_no($ddno); $input->SetTotal_fee($money*100); $input->SetTime_start(date("YmdHis")); $input->SetTime_expire(date("YmdHis", time() + 600)); $input->SetGoods_tag($tag); $input->SetNotify_url($notify_url); $input->SetTrade_type("NATIVE"); $input->SetProduct_id($ddno); $result = $notify->GetPayUrl($input); if($result[err_code_des]){ printerror($result[err_code_des],"/e/member/cp/",1,0,1); } //print_r($result); $url = $result["code_url"]; $public_diyr['pagetitle']="在线支付"; $body='{"Code":200,"Message":"生成订单完毕","money":'.$money.',"channel":"微信扫码","paytype":"pcweixin","ordernumber":"'.$ddno.'","qrcode":"'.$url.'"}'; echo $body; ?>