Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
projecttwo
Project
Project
Details
Activity
Releases
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
wangtao
projecttwo
Commits
87a57a66
Commit
87a57a66
authored
Jun 23, 2025
by
wangzhengwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exp订单逻辑修改
parent
0421d2bb
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
5 deletions
+21
-5
Util.php
app/api/controller/Util.php
+6
-0
AddExperience.php
app/api/middleware/AddExperience.php
+1
-1
ExperienceService.php
app/api/service/ExperienceService.php
+2
-1
PayService.php
app/api/service/PayService.php
+12
-3
No files found.
app/api/controller/Util.php
View file @
87a57a66
...
...
@@ -3,6 +3,7 @@
namespace
app\api\controller
;
use
app\api\middleware\Auth
;
use
app\api\service\PayService
;
use
app\BaseController
;
use
app\model\system\SystemArea
;
...
...
@@ -21,4 +22,9 @@ class Util extends BaseController
}
public
function
test
()
{
return
PayService
::
test
();
}
}
\ No newline at end of file
app/api/middleware/AddExperience.php
View file @
87a57a66
...
...
@@ -48,7 +48,7 @@ class AddExperience
$userId
=
Db
::
name
(
'user'
)
->
where
(
'token'
,
$token
)
->
where
(
'
delete_time'
,
null
)
->
where
(
'
is_del'
,
0
)
->
value
(
'id'
);
if
(
$userId
)
{
...
...
app/api/service/ExperienceService.php
View file @
87a57a66
...
...
@@ -36,7 +36,7 @@ class ExperienceService
return
;
}
}
$extraData
=
array_merge
(
$extraData
,
[
'action'
=>
$rule
[
'action'
]]);
Db
::
startTrans
();
try
{
// 增加用户经验
...
...
@@ -79,6 +79,7 @@ class ExperienceService
self
::
addExperience
(
$userId
,
$rule
,
[
'order_id'
=>
$payment
[
'order_id'
]
??
0
,
'order_type'
=>
$payment
[
'order_type'
]
??
null
,
'fj_payment_id'
=>
$payment
[
'fj_payment_id'
]
??
0
]);
}
...
...
app/api/service/PayService.php
View file @
87a57a66
...
...
@@ -212,9 +212,10 @@ class PayService
//增加销量
ExperienceService
::
addPaymentExperience
(
$payment
[
'user_id'
],
$payment
,
[
'order_id'
=>
$payment
[
'order_id'
],
'order_type'
=>
$payment
[
'order_type'
],
'fj_payment_id'
=>
$payment
[
'id'
]]
,
'pay/course'
);
}
elseif
(
$payment
[
'order_type'
]
==
self
::
ORDER_TYPE_CERT
)
{
// 处理证书购买逻辑
Db
::
name
(
'cert_order'
)
...
...
@@ -222,11 +223,10 @@ class PayService
->
update
([
'status'
=>
1
]);
ExperienceService
::
addPaymentExperience
(
$payment
[
'user_id'
],
$payment
,
[
'order_id'
=>
$payment
[
'order_id'
],
'order_type'
=>
$payment
[
'order_type'
],
'fj_payment_id'
=>
$payment
[
'id'
]]
,
'pay/cert'
);
}
// 可以添加其他业务逻辑,如发送通知等
}
catch
(
\Exception
$e
)
{
Log
::
error
(
"支付后业务处理失败: "
.
$e
->
getMessage
());
...
...
@@ -369,4 +369,13 @@ class PayService
}
}
public
static
function
test
()
{
$payment
=
Db
::
name
(
'payment'
)
->
where
(
'order_no'
,
'kc-010-250623134620463'
)
->
lock
(
true
)
->
find
();
self
::
handleBusinessAfterPayment
(
$payment
);
}
}
\ No newline at end of file
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