Controller|Controller CURL调用接口
$curlPost = array( 'unid'=> isset($data['unid'])?$data['unid']:'', 'term_suiji'=> isset($data['suiji'])?$data['suiji']:'', 'wxorder_id'=> 'SYKX'.date('YmdHis').rand(10000,99999), 'pay_money' => '0', 'pay_date'=> date('Y-m-d H:i:s'), ); $ch = curl_init(); //初始化 curl curl_setopt($ch, CURLOPT_URL,$GLOBALS['yurl'].'?service=App.Term.BuyTerm'); curl_setopt($ch, CURLOPT_POST, 1); //post提交方式 curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = https://www.it610.com/article/curl_exec($ch); //运行curl curl_close($ch); $data = json_decode($data,true); // echo' '; if($data['ret'] == 200){ $this->Session->setFlash("分配成功"); }else{ $this->Session->setFlash("分配失败:".$data['msg']); } echo " var index = parent.layer.getFrameIndex(window.name); parent.layer.close(index); parent.location.href='https://www.it610.com/Buy/Index'; "; // window.parent.location.reload(); //刷新父页面 exit();
推荐阅读
- SpringBoot调用公共模块的自定义注解失效的解决
- thinkphp|thinkphp 3.2 如何调用第三方类库
- 分享!如何分分钟实现微信扫二维码调用外部浏览器打开指定页面的功能
- Swift|Swift ----viewController 中addChildViewController
- WKWebview|WKWebview js 调用oc 和oc调用js
- H5、js调用手机通话|H5、js调用手机通话,短信
- Swift高级应用|Swift高级应用 -01
- UIPageViewController|UIPageViewController issue
- Application|linux应用编程笔记(5)系统调用文件编程方法实现文件复制
- 手写|手写 React-Native 方法调用式的 Modal 弹框、Toast 提示