You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.7 KiB
58 lines
1.7 KiB
<?php
|
|
/**
|
|
* Created by PhpStorm.
|
|
* User: Administrator
|
|
* Date: 2018-11-02
|
|
* Time: 14:14
|
|
*/
|
|
|
|
namespace crm;
|
|
|
|
|
|
|
|
class Crm
|
|
{
|
|
private $url = 'https://jccrmx.jucheng01.net/member.php/User/orderDataAdd';
|
|
/**
|
|
* 订单数据录入
|
|
* @param $project_id 项目id
|
|
* @param $order_money 订单金额
|
|
* @param $order_module_type 订单类型
|
|
* @param $order_module_name 订单类型名称
|
|
* @return array
|
|
*/
|
|
public function orderDataAdd($project_id,$order_money,$order_module_type,$order_module_name)
|
|
{
|
|
$data = [
|
|
'project_id'=>$project_id,
|
|
'order_money'=>$order_money,
|
|
'order_module_type'=>$order_module_type,
|
|
'order_module_name'=>$order_module_name,
|
|
];
|
|
$res = $this->httpPost($this->url,$data);
|
|
return $res;
|
|
}
|
|
public function httpPost($url, $data, $json_transfer = 1)
|
|
{
|
|
$postData = http_build_query($data);
|
|
|
|
$curl = curl_init();
|
|
curl_setopt($curl, CURLOPT_URL, $url);
|
|
curl_setopt($curl, CURLOPT_HEADER, 0);
|
|
curl_setopt($curl, CURLOPT_TIMEOUT, 5);
|
|
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
|
curl_setopt($curl, CURLOPT_POST, 1);
|
|
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
|
|
curl_setopt($curl, CURLOPT_POSTFIELDS, $postData);
|
|
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
|
|
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
|
|
$data = curl_exec($curl);
|
|
|
|
if (curl_errno($curl)) {
|
|
return curl_error($curl);
|
|
}
|
|
curl_close($curl);
|
|
|
|
return json_decode($data, true);
|
|
}
|
|
} |