add-sylive-plan

This commit is contained in:
lccsw
2023-05-05 11:41:59 +08:00
parent e6420e6638
commit 44d9b47b57
3 changed files with 48 additions and 7 deletions
+40
View File
@@ -536,4 +536,44 @@ class Syt extends CI_Controller
echo '执行结束';
}
}
public function thApi(){
require_once COMMPATH . 'third_party/SytApi.php';
$this->load->model('market/market_sylive_user_model', 'user_model');
$this->load->model('market/market_sylive_order_model');
$this->load->model('market/market_sylive_groups_user_model', 'groups_user_model');
$this->load->model('market/market_sylive_organization_model');
$page = $this->input->get('page');
$size = $this->input->get('size');
!$page && $page=1;
!$size && $size=20;
$where = [
"activityId" => 11,
"areaId" =>0
];
$count = $this->market_sylive_order_model->count($where);
if($count>0){
$rows = $this->market_sylive_order_model->select($where,'id asc',$page,$size);
$syt = new SytApi();
foreach ($rows as $key => $val) {
$gwUser = $this->user_model->get(['userId'=>$val["cfUserId"]]);
$dlrCode = "";
$mediaCaName = "";
$leadNo = $val["userId"];
//获取意向网点编码
if($gwUser){
$mediaCaName = $gwUser['uname'];
$group_user = $this->groups_user_model->get(['activityId' => $val["activityId"], 'userId' => $val['cfUserId'], 'status' => 0]);
$biz = $this->market_sylive_organization_model->get(['organizationId'=>$group_user['bizId']]);
$dlrCode = $biz['comments'];
}
$syt->Tj($dlrCode,"活动客户",$val["mobile"],$mediaCaName,$leadNo);
$this->market_sylive_order_model->update(["areaId"=>1],["id"=>$val["id"]]);
}
echo "剩余:".$count-$size;
}else{
echo "无需执行";
}
}
}
@@ -1,6 +1,6 @@
<?php
class Syt{
class SytApi{
/**
* @param $dlrCode 意向网点编码
@@ -12,7 +12,8 @@ class Syt{
*/
public function Tj($dlrCode,$custName,$phone,$mediaCaName,$leadNo){
// $url = 'http://124.70.73.241:31169/webservice/sfw/sfwWsSfw001?wsdl'; //测试地址
$url = 'http://124.70.73.241:31198/webservice/sfw/sfwWsSfw001?wsdl';//正式地址
// $url = 'http://124.70.73.241:31198/webservice/sfw/sfwWsSfw001?wsdl';//预上线地址
$url = 'http://121.36.75.167:6500/webservice/sfw/sfwWsSfw001?wsdl';//正式地址
$headers = ['Content-type: text/xml; charset=utf-8'];
$post_data =
@@ -79,12 +80,12 @@ class Syt{
"DRIVE_DATE":"",
"DLR_CODE":"$dlrCode",
"REMARK":"",
"ACTION_CODE":"",
"ACTION_NAME":"",
"ACTION_CODE":"YXHD20220519001",
"ACTION_NAME":"新长效活动",
"RESULT":"",
"MSG":"",
"LEAD_NO":"$leadNo",
"ORG_BU":"",
"ORG_BU":"C",
"MEDIA_CA_NAME":"$mediaCaName",
}
]
+2 -2
View File
@@ -593,8 +593,8 @@ class Act extends Wx {
}
// if($a_id==11){
// //通知第三方
// require_once COMMPATH . 'third_party/Syt.php';
// $syt = new Syt();
// require_once COMMPATH . 'third_party/SytApi.php';
// $syt = new SytApi();
// $dlrCode = "";
// $mediaCaName = "";
// $leadNo = $this->uid;