Files
liche/home/controllers/neta/Cloud.php
T
xiaoyu 8e31aeb2d4 neta
2023-12-19 17:49:39 +08:00

59 lines
1.8 KiB
PHP

<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Cloud extends CI_Controller
{
public function index()
{
//echo "<h1>404</h1>";exit;
//生产地址
$url = 'https://salesapp.hozonauto.com/appservice/app/if/salesclue/createSalesclue';
//测试地址
//$url = 'https://salespp-sit.hozonauto.com/appservice/app/if/salesclue/createSalesclue';
$name = '测试';
$comments = '101207';
$mobile = '18150117877';
$samobile = '18150117877';
$data[] = array(
'cusSource3' => '023409',
'customerName' => $name,
'dealerCode' => $comments,
'fromSystem' => "好店云",
'mobile' => $mobile,
'saMobile' => $samobile,
'cusType' => '30111001',
'remark' => "区域云店测试",
);
print_r(json_encode($data,JSON_UNESCAPED_UNICODE));exit;
$data = json_encode($data, JSON_UNESCAPED_UNICODE);
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//https
if (strlen($url) > 5 && strtolower(substr($url, 0, 5)) == "https") {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
}
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json; charset=utf-8',
'Content-Length: ' . strlen($data)
)
);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
var_dump($response);
}
}