Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
loveisland
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘小敏
loveisland
Commits
f26a1d2b
Commit
f26a1d2b
authored
Jul 16, 2026
by
刘小敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(xhs-ad): 修复转化接口改用客户端传入click_id
parent
e56e6914
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
13 deletions
+5
-13
XhsAd.php
addons/shopro/controller/user/XhsAd.php
+4
-12
XhsAd.php
addons/shopro/validate/user/XhsAd.php
+1
-1
No files found.
addons/shopro/controller/user/XhsAd.php
View file @
f26a1d2b
...
...
@@ -84,7 +84,7 @@ class XhsAd extends Common
$this
->
error
(
'请求方式错误'
);
}
$params
=
$this
->
request
->
only
([
'conversion_type'
,
'value'
,
'order_id'
]);
$params
=
$this
->
request
->
only
([
'c
lick_id'
,
'c
onversion_type'
,
'value'
,
'order_id'
]);
$this
->
svalidate
(
$params
,
'.conversion'
);
$user
=
auth_user
();
...
...
@@ -97,19 +97,14 @@ class XhsAd extends Common
$this
->
error
(
'用户未登录'
);
}
$clickId
=
$params
[
'click_id'
];
$conversionType
=
$params
[
'conversion_type'
];
$value
=
floatval
(
$params
[
'value'
]
??
0
);
$orderId
=
$params
[
'order_id'
]
??
''
;
// 查询有效追踪记录
// 查询有效追踪记录
(用于关联 tracking_id)
$tracking
=
AdTrackingModel
::
getValidByUser
(
$userId
);
$clickId
=
''
;
$trackingId
=
0
;
$status
=
ConversionLogModel
::
STATUS_NO_TRACK
;
if
(
$tracking
)
{
$clickId
=
$tracking
->
click_id
;
$trackingId
=
$tracking
->
id
;
$trackingId
=
$tracking
?
$tracking
->
id
:
0
;
$status
=
ConversionLogModel
::
STATUS_PENDING
;
// 去重检查
...
...
@@ -117,9 +112,6 @@ class XhsAd extends Common
custom_log
(
'[xhs.conversion] 重复转化,拒绝记录, click_id='
.
$clickId
.
', type='
.
$conversionType
.
', order='
.
$orderId
,
$userId
,
'xhs_ad'
,
'warning'
);
$this
->
error
(
'该转化事件已记录,请勿重复提交'
);
}
}
else
{
custom_log
(
'[xhs.conversion] 无有效追踪记录,记录为无需回传, user_id='
.
$userId
,
$userId
,
'xhs_ad'
,
'warning'
);
}
$now
=
time
();
...
...
addons/shopro/validate/user/XhsAd.php
View file @
f26a1d2b
...
...
@@ -30,6 +30,6 @@ class XhsAd extends Validate
protected
$scene
=
[
'track'
=>
[
'click_id'
,
'request_id'
,
'event_type'
,
'landing_page'
],
'conversion'
=>
[
'conversion_type'
,
'value'
,
'order_id'
],
'conversion'
=>
[
'c
lick_id'
,
'c
onversion_type'
,
'value'
,
'order_id'
],
];
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment