From 432ecb5fb06c8244c5b904f2bb99abd7cf34487d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=B1=BC=E5=BC=80=E5=8F=91?= Date: Mon, 17 Jun 2024 18:31:42 +0800 Subject: [PATCH] 0617 --- home/controllers/h5/market/sylive2/Act.php | 118 ++++++++++-------- home/controllers/h5/market/sylive2/Notify.php | 14 ++- 2 files changed, 79 insertions(+), 53 deletions(-) diff --git a/home/controllers/h5/market/sylive2/Act.php b/home/controllers/h5/market/sylive2/Act.php index ae7ad672..79a2e6d6 100644 --- a/home/controllers/h5/market/sylive2/Act.php +++ b/home/controllers/h5/market/sylive2/Act.php @@ -133,6 +133,16 @@ class Act extends Wx $where = ['activityId' => $this->a_id, 'userId' => $this->uid]; $appoint = $this->market_sylive_customer_model->get($where); $info['is_appoint'] = $appoint ? true : false; + + if($jsondata['bottoms']){ + foreach ($jsondata['bottoms'] as $v) { + if ($v['urlType'] == 'enroll') { + $jsondata['signBespeak']['status'] = 1; + break; + } + } + } + if ($jsondata['signBespeak']['status']) { $info['appoint_mobile'] = true; if (!$user['nickname'] && !$user['headimg']) { @@ -180,6 +190,14 @@ class Act extends Wx if ($rows) { $act_row = $this->market_sylive_activity_model->get(['activityId' => $a_id]); $jsondata = json_decode($act_row['jsondata'], true); + if($jsondata['bottoms']){ + foreach ($jsondata['bottoms'] as $v) { + if ($v['urlType'] == 'enroll') { + $jsondata['signBespeak']['status'] = 1; + break; + } + } + } $users = []; $uids = implode(',', array_unique(array_column($rows, 'userId'))); if ($uids) { @@ -583,8 +601,8 @@ class Act extends Wx $p_user['levelId2'] && $add_data['levelId2'] = $p_user['levelId2']; $p_user['levelId3'] && $add_data['levelId3'] = $p_user['levelId3']; $add_data['cfUserId'] && $add_data['status'] = 1; - $this->market_sylive_customer_model->add($add_data); - if ($jsondata['signBespeak']['status'] && $jsondata['signBespeak']['itemId']) { //绑定新增商品订单 + $cutomer_id = $this->market_sylive_customer_model->add($add_data); + if ($cutomer_id && $jsondata['signBespeak']['itemId']) { //绑定新增商品订单 $itemId = $jsondata['signBespeak']['itemId']; $item = $this->market_sylive_items_model->get(['itemId' => $itemId]); $this->load->helper('order'); @@ -596,7 +614,7 @@ class Act extends Wx 'itemTitle' => $item['title'], 'itemPrice' => 0, 'totalPrice' => 0, - 'expireTime' => 0,//订单过sylive2_entity期时间 + 'expireTime' => 0,//订单过期时间 'status' => 1, 'payTime' => date('Y-m-d H:i:s'), 'createTime' => date('Y-m-d H:i:s') @@ -639,53 +657,53 @@ class Act extends Wx // $syt->Tj($dlrCode,"活动客户",$mobile,$mediaCaName,$leadNo); // } - if ($a_id == 27) { - //生产地址 - $url = 'https://salesapp.hozonauto.com/appservice/app/if/salesclue/createSalesclue'; - - //获取意向网点编码 - if ($p_user) { - $user = $this->user_model->get(['userId' => $act_user_row['channelId']]); - $biz = $this->market_sylive_organization_model->get(['organizationId' => $user['bizId']]); - } - - if ($biz['comments']) { - $data[] = array( - 'cusSource3' => '023410', - 'customerName' => "活动客户", - 'dealerCode' => $biz['comments'], - 'fromSystem' => "好店云", - 'mobile' => $mobile, - 'saMobile' => $user['mobile'] ? $user['mobile'] : '', - 'cusType' => '30111001', - 'remark' => "2024新春活动", - ); - - $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, 'neta.log', 'market/sylive'); - } - } +// if ($a_id == 27) { +// //生产地址 +// $url = 'https://salesapp.hozonauto.com/appservice/app/if/salesclue/createSalesclue'; +// +// //获取意向网点编码 +// if ($p_user) { +// $user = $this->user_model->get(['userId' => $act_user_row['channelId']]); +// $biz = $this->market_sylive_organization_model->get(['organizationId' => $user['bizId']]); +// } +// +// if ($biz['comments']) { +// $data[] = array( +// 'cusSource3' => '023410', +// 'customerName' => "活动客户", +// 'dealerCode' => $biz['comments'], +// 'fromSystem' => "好店云", +// 'mobile' => $mobile, +// 'saMobile' => $user['mobile'] ? $user['mobile'] : '', +// 'cusType' => '30111001', +// 'remark' => "2024新春活动", +// ); +// +// $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, 'neta.log', 'market/sylive'); +// } +// } } $redis->delete($key); $this->show_json(array('ukey' => $ukey), 200, '预约成功'); diff --git a/home/controllers/h5/market/sylive2/Notify.php b/home/controllers/h5/market/sylive2/Notify.php index 1d6f928c..83c3b2c7 100644 --- a/home/controllers/h5/market/sylive2/Notify.php +++ b/home/controllers/h5/market/sylive2/Notify.php @@ -63,6 +63,14 @@ class Notify extends CI_Controller $res = $this->order_model->update(['status' => 1, 'payTime' => date('Y-m-d H:i:s')], ['id' => $order['id']]); $act = $this->market_sylive_activity_model->get(['activityId' => $order['activityId']]); $jsondata = json_decode($act['jsondata'], true); + if($jsondata['bottoms']){ + foreach ($jsondata['bottoms'] as $v) { + if ($v['urlType'] == 'enroll') { + $jsondata['signBespeak']['status'] = 1; + break; + } + } + } if ($jsondata['signBespeak']['status'] && $jsondata['signBespeak']['itemId'] == $order['itemId']) { //绑定新增商品订单 $kpi = 'beforeOrder'; } else { @@ -72,9 +80,9 @@ class Notify extends CI_Controller $act_user = $this->act_user_model->get(['userId' => $order['userId'], 'activityId' => $order['activityId']]); $cf_uid = $act_user['channelId']; - if ($kpi == 'order' && in_array($order['activityId'], array(21))) { - $cf_uid = $act_user['channelId'] == $act_user['pid'] ? $act_user['channelId'] : $act_user['pid']; - } +// if ($kpi == 'order' && in_array($order['activityId'], array(21))) { +// $cf_uid = $act_user['channelId'] == $act_user['pid'] ? $act_user['channelId'] : $act_user['pid']; +// } if ($kpi == 'order' && $act['orderType'] && $act_user['pid']) { $cf_uid = $act_user['pid']; }