$value) { $_tmp = explode(',', $value); $total += (int)$_tmp[12]; } $total = $total * 100; $tools = new JsApiPay(); $openId = $tools->GetOpenid(); unlink('../../upload/' . $userid . '.txt'); $input = new WxPayUnifiedOrder(); $input->SetBody("广告投放"); $input->SetAttach($ordermsg); $input->SetOut_trade_no(WxPayConfig::MCHID.date("YmdHis")); $input->SetTotal_fee($total); $input->SetTime_start(date("YmdHis")); $input->SetTime_expire(date("YmdHis", time() + 600)); $input->SetNotify_url("http://erp.itxxoo.com/Wxpay/notify"); $input->SetTrade_type("JSAPI"); $input->SetOpenid($openId); $order = WxPayApi::unifiedOrder($input); $jsApiParameters = $tools->GetJsApiParameters($order); $editAddress = $tools->GetEditAddressParameters(); } else { $myfile = fopen('http://jiazheng.itxxoo.com/upload/' . $userid . '.txt', "r"); $ordermsg = fgets($myfile); fclose($myfile); $arr = explode('#', $ordermsg); $total = $arr[1] * 100; $tools = new JsApiPay(); $openId = $tools->GetOpenid(); unlink('../../../jiazheng/upload/' . $userid . '.txt'); $input = new WxPayUnifiedOrder(); $input->SetBody("家政预约"); $input->SetAttach($ordermsg); $input->SetOut_trade_no(WxPayConfig::MCHID.date("YmdHis")); $input->SetTotal_fee($total); $input->SetTime_start(date("YmdHis")); $input->SetTime_expire(date("YmdHis", time() + 600)); $input->SetNotify_url("http://jiazheng.itxxoo.com/Wxpay/notify"); $input->SetTrade_type("JSAPI"); $input->SetOpenid($openId); $order = WxPayApi::unifiedOrder($input); $jsApiParameters = $tools->GetJsApiParameters($order); $editAddress = $tools->GetEditAddressParameters(); } ?>