From 457388bb7fd74e542ce201045279ce7f68ed6b3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=B1=BC=E5=BC=80=E5=8F=91?= Date: Fri, 21 Jun 2024 19:03:50 +0800 Subject: [PATCH] orderType --- home/controllers/h5/market/sylive2/Act.php | 11 +++++++---- home/controllers/h5/market/sylive2/Item.php | 2 +- home/controllers/h5/market/sylive2/Notify.php | 6 +++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/home/controllers/h5/market/sylive2/Act.php b/home/controllers/h5/market/sylive2/Act.php index cfdaee25..bc9a6241 100644 --- a/home/controllers/h5/market/sylive2/Act.php +++ b/home/controllers/h5/market/sylive2/Act.php @@ -582,7 +582,12 @@ class Act extends Wx $ac_row = $this->market_sylive_activity_model->get(['activityId' => $a_id], 'jsondata,orderType'); $jsondata = json_decode($ac_row['jsondata'], true); $act_user_row = $this->act_user_model->get(['id' => $this->act_uid]); - $p_user = $this->act_user_model->get(['userId' => $act_user_row['channelId'], 'activityId' => $a_id]); + if($ac_row['orderType'] && $act_user_row['pid']){ + $cf_uid = $act_user_row['pid']; + }else{ + $cf_uid = $act_user_row['channelId']; + } + $p_user = $this->act_user_model->get(['userId' => $cf_uid, 'activityId' => $a_id]); $ukey = md5($a_id . $mobile); $add_data = [ @@ -627,12 +632,10 @@ class Act extends Wx $p_user['levelId2'] && $unpay['levelId2'] = $p_user['levelId2']; $p_user['levelId3'] && $unpay['levelId3'] = $p_user['levelId3']; $p_user['userId'] && $unpay['cfUserId'] = $p_user['userId']; - $ac_row['orderType'] && $unpay['cfUserId'] = $act_user_row['pid']; $order_id = $this->market_sylive_order_model->add($unpay); if (is_numeric($order_id)) { //添加kpi - $params = ['a_id' => $a_id, 'uid' => $this->uid, 'cf_uid' => $act_user_row['channelId'], 'kpi' => 'beforeOrder']; - $ac_row['orderType'] && $params['cf_uid'] = $act_user_row['pid']; + $params = ['a_id' => $a_id, 'uid' => $this->uid, 'cf_uid' => $cf_uid, 'kpi' => 'beforeOrder']; $order_id && $params['tagId'] = intval($order_id); $params['itemId'] = $itemId; $params['jsondata'] = [ diff --git a/home/controllers/h5/market/sylive2/Item.php b/home/controllers/h5/market/sylive2/Item.php index d7278787..d1245e25 100644 --- a/home/controllers/h5/market/sylive2/Item.php +++ b/home/controllers/h5/market/sylive2/Item.php @@ -158,7 +158,7 @@ class Item extends Wx{ $act_user = $this->act_user_model->get(['userId'=>$this->uid,'activityId'=>$a_id]); $act = $this->market_sylive_activity_model->get(['activityId'=>$row['activityId']]); - if($act['orderType'] && $act_user['channelId'] != $act_user['pid'] && $act_user['pid'] ) { + if($act['orderType'] && $act_user['pid'] ) { $p_user = $this->act_user_model->get(['userId'=>$act_user['pid'], 'activityId'=>$a_id]); } else{ $p_user = $this->act_user_model->get(['userId'=>$act_user['channelId'], 'activityId'=>$a_id]); diff --git a/home/controllers/h5/market/sylive2/Notify.php b/home/controllers/h5/market/sylive2/Notify.php index 4ecb8542..913877cc 100644 --- a/home/controllers/h5/market/sylive2/Notify.php +++ b/home/controllers/h5/market/sylive2/Notify.php @@ -78,13 +78,13 @@ class Notify extends CI_Controller } if ($res) { $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' && $act['orderType'] && $act_user['pid']) { + if ($act['orderType'] && $act_user['pid']) { $cf_uid = $act_user['pid']; + }else{ + $cf_uid = $act_user['channelId']; } $params = [