Files
liche/home/controllers/Welcome.php
T
小鱼开发 00352f784f fixed
2024-06-14 19:13:27 +08:00

125 lines
4.7 KiB
PHP

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function index()
{
echo "<h1>404</h1>";exit;
}
public function neta(){
//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';
$cus = array('18878903790');
$comments = '100681'; //门店编码
$samobile = '18677222303';//销售手机
$cusSource3 = '023305'; //本地通
//$cusSource3 = '023409'; //区域云店 福泉厦
$city_id = '350200';
//$voId = $city_id . date('mdHis') . sprintf("%06d", rand(1,999999));
foreach ($cus as $v){
$voId = $city_id . date('mdHis') . sprintf("%06d", rand(1,999999));
$data[] = array(
'voId' => $voId,
'cusSource3' => $cusSource3,
'customerName' => '客户',
'dealerCode' => $comments,
'fromSystem' => "好店云",
'mobile' => $v,
'saMobile' => $samobile,
'cusType' => '30111001',
'remark' => '网约车',
'intentModel' => "哪吒AYA",
);
}
print_r(json_encode($data,JSON_UNESCAPED_UNICODE));
$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);
}
public function add_clues()
{
$mobiles = array('18408567196','18685673397','18741222998','13101230706','13220389558','13059007612','18714302015','18746888460','13955837596','13956279578','13835418266','13903447111','13751465293','13760911966','13923278348','15015509310','13760691919','13926216673','13751923279','13760120603','13923478684','13924643186','15014028058','13812356597','13732972674','13879017329','15032306103','13781019554','15036557867','13958603552','13967885618','13968714482','13735296040','13886995246','15007430826','13807366253','15073459625','13975158758','13919163276','13983472574','13945299803','15770411009','15284510321','15697073428','15661287137','15300239701','15082662635','15208179108','15397672978','15182496521','15390483148','15681200329','15181866162','15255533386','15269458953','15169023018','15322844785','15119165917');
$dealerCode = '100231';
foreach ($mobiles as $k => $v) {
$city_id = '350200';
$voId = $city_id . date('mdHis') . sprintf("%06d", rand(1,999999));
$data[] = array(
'voId' => $voId,
'cusSource3' => '023409',//023410:云店营销节点
'customerName' => '客户',
'dealerCode' => $dealerCode,
'fromSystem' => "好店云",
'mobile' => $v,
'saMobile' => '18659197547',
'cusType' => '30111001',
'remark' => "",
'intentModel' => "",
);
}
$data = json_encode($data, JSON_UNESCAPED_UNICODE);
$url = 'https://salesapp.hozonauto.com/appservice/app/if/salesclue/createSalesclue';
$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);
}
}