From e4387f1e57b00e52dcfc606fd2733e578bd4ce07 Mon Sep 17 00:00:00 2001 From: xiaoyu Date: Wed, 30 Aug 2023 11:35:53 +0800 Subject: [PATCH] neta --- home/controllers/Welcome.php | 4 ++ home/controllers/h5/market/sylive2/Act.php | 52 ++++++++++++++++++++ home/controllers/h5/market/sylive2/Item.php | 54 +++++++++++++++++++++ 3 files changed, 110 insertions(+) diff --git a/home/controllers/Welcome.php b/home/controllers/Welcome.php index ad7393cb..cbc1f25a 100644 --- a/home/controllers/Welcome.php +++ b/home/controllers/Welcome.php @@ -4,6 +4,10 @@ defined('BASEPATH') OR exit('No direct script access allowed'); class Welcome extends CI_Controller { public function index(){ + echo '404';exit; + //生产地址 + $url = 'https://salesapp.hozonauto.com/appservice/app/if/salesclue/createSalesclue'; + //测试地址 $url = 'https://salesapp-sit.hozonauto.com/appservice/app/if/salesclue/createSalesclue'; $data[] = array( diff --git a/home/controllers/h5/market/sylive2/Act.php b/home/controllers/h5/market/sylive2/Act.php index 1d96969b..2181f69d 100644 --- a/home/controllers/h5/market/sylive2/Act.php +++ b/home/controllers/h5/market/sylive2/Act.php @@ -608,6 +608,58 @@ class Act extends Wx { // } // $syt->Tj($dlrCode,"活动客户",$mobile,$mediaCaName,$leadNo); // } + + if($a_id == 20){ + //生产地址 + $url = 'https://salesapp.hozonauto.com/appservice/app/if/salesclue/createSalesclue'; + //测试地址 + $url = 'https://salesapp-sit.hozonauto.com/appservice/app/if/salesclue/createSalesclue'; + + //获取意向网点编码 + if($p_user){ + $user = $this->user_model->get(['userId'=>$act_user_row['channelId']]); + $group_user = $this->groups_user_model->get(['activityId' => $a_id, 'userId' => $act_user_row['channelId'], 'status' => 0]); + $biz = $this->market_sylive_organization_model->get(['organizationId'=>$group_user['bizId']]); + $dlrCode = $biz['comments']; + } + + $cusSource3 = ''; + + $data[] = array( + 'cusSource3' => $cusSource3, + 'customerName' => "活动客户", + 'dealerCode' => $dlrCode, + 'fromSystem' => "好店云", + 'mobile' => $mobile, + 'saMobile' => $user['mobile'], + 'cusType' => '30111001', + 'remark' => "99宠你节", + ); + + $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); + curl_close($ch); + debug_log("[info]# " . $data."\n".$response, 'market/sylive','neta.log'); + } } $redis->delete($key); $this->show_json('',200, '预约成功'); diff --git a/home/controllers/h5/market/sylive2/Item.php b/home/controllers/h5/market/sylive2/Item.php index 790263c9..4e10215e 100644 --- a/home/controllers/h5/market/sylive2/Item.php +++ b/home/controllers/h5/market/sylive2/Item.php @@ -141,6 +141,7 @@ class Item extends Wx{ if(!$code || ($redis->get($code_key)!=$code)){ $this->show_json('',400,'请输入正确验证码'); } + //判断是否已支付 $o_row = $this->market_sylive_order_model->get(['itemId'=>$itemId,'activityId'=>$a_id,'status'=>1,'userId'=>$this->uid,'type'=>0]); if($o_row){ @@ -234,6 +235,59 @@ class Item extends Wx{ 'wxjson' => $result['data'], 'oid' => $unpay['id'], ]; + + if($a_id == 20){ + //生产地址 + $url = 'https://salesapp.hozonauto.com/appservice/app/if/salesclue/createSalesclue'; + //测试地址 + $url = 'https://salesapp-sit.hozonauto.com/appservice/app/if/salesclue/createSalesclue'; + + //获取意向网点编码 + if($p_user){ + $user = $this->user_model->get(['userId'=>$act_user['channelId']]); + $group_user = $this->groups_user_model->get(['activityId' => $a_id, 'userId' => $act_user['channelId'], 'status' => 0]); + $biz = $this->market_sylive_organization_model->get(['organizationId'=>$group_user['bizId']]); + $dlrCode = $biz['comments']; + } + + $cusSource3 = ''; + + $data[] = array( + 'cusSource3' => $cusSource3, + 'customerName' => "活动客户", + 'dealerCode' => $dlrCode, + 'fromSystem' => "好店云", + 'mobile' => $mobile, + 'saMobile' => $user['mobile'], + 'cusType' => '30111001', + 'remark' => "99宠你节", + ); + + $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); + curl_close($ch); + debug_log("[info]# " . $data."\n".$response, 'market/sylive','neta.log'); + } + $this->show_json($data,200,'操作成功'); }