Files
liche/home/controllers/Welcome.php
T
2024-02-05 10:12:43 +08:00

117 lines
4.4 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';
$name = '超级化妆品销售达人'; //客户姓名
$mobile = '13625834316';//客户手机
$comments = '100647'; //门店编码
$samobile = '18923392948';//销售手机
$city_id = '350200';
$voId = $city_id . date('mdHis') . sprintf("%06d", rand(1,999999));
$data[] = array(
'voId' => $voId,
'cusSource3' => '023409',
'customerName' => $name,
'dealerCode' => $comments,
'fromSystem' => "好店云",
'mobile' => $mobile,
'saMobile' => $samobile,
'cusType' => '30111001',
'remark' => "",
'intentModel' => "哪吒X",
);
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('13124078183','13950216673','13625099806','15806064642','18359124166','18506081931','18046404796','13960855123','18659119209','18359768996','13290930865','13799312264','18506068867','13609575537','18659229626','18759223604','18250495067','18006917070','18350186430','13950412215','13615054818','13101431157','18259150643','13960741877','13850182332','18965055255','15960099209','15985747193','18805022611','15377915618','13338443200','13805014290','13720825977','18359169978','18250853102','13805057858','18359168838','13788898541','13960987292','13459479065','17506079707','18750718803','17506061272','18396132185','13514078677','18259072881','18558752932','19959106359','17805950156','13489029633','13599548606','15060030091','15080042524','13905914852','18106021611');
foreach ($mobiles as $k => $v) {
$city_id = '350200';
$voId = $city_id . date('mdHis') . sprintf("%06d", rand(1,999999));
$data[] = array(
'voId' => $voId,
'cusSource3' => '023409',
'customerName' => '客户',
'dealerCode' => '101207',
'fromSystem' => "好店云",
'mobile' => $v,
'saMobile' => '13950053469',
'cusType' => '30111001',
'remark' => "",
'intentModel' => "哪吒V",
);
}
$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);
}
}