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
85d24c85
Commit
85d24c85
authored
Jun 16, 2025
by
wangzhengwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单storeuser
parent
9c804c83
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
PayController.php
app/api/controller/PayController.php
+1
-0
PayService.php
app/api/service/PayService.php
+15
-4
No files found.
app/api/controller/PayController.php
View file @
85d24c85
...
...
@@ -143,6 +143,7 @@ class PayController
// 查询支付订单
$payment
=
Db
::
name
(
'payment'
)
->
where
(
'order_no'
,
$orderNo
)
->
where
(
'pay_status'
,
0
)
->
find
();
if
(
!
$payment
||
$payment
[
'pay_method'
]
!=
PayService
::
PAY_METHOD_WECHAT
)
{
...
...
app/api/service/PayService.php
View file @
85d24c85
...
...
@@ -46,11 +46,20 @@ class PayService
{
try
{
if
(
empty
(
$orderId
)
||
!
in_array
(
$orderType
,
[
1
,
2
]))
{
throw
new
\Exception
(
'orderType不合法'
);
}
if
(
$orderType
==
self
::
ORDER_TYPE_COURSE
)
{
$
title
=
Db
::
name
(
'course'
)
->
where
(
'id'
,
$orderId
)
->
value
(
'title'
);
$
store
=
Db
::
name
(
'course'
)
->
where
(
'id'
,
$orderId
)
->
field
(
'title,user_id,id'
)
->
find
(
);
}
else
{
$
title
=
Db
::
name
(
'cert'
)
->
where
(
'id'
,
$orderId
)
->
value
(
'title'
);
$
store
=
Db
::
name
(
'cert'
)
->
where
(
'id'
,
$orderId
)
->
field
(
'title,user_id,id'
)
->
find
(
);
}
if
(
empty
(
$store
))
{
throw
new
\Exception
(
'原商品不存在'
);
}
$orderNoType
=
match
(
$orderType
)
{
1
=>
'kc'
,
2
=>
'zs'
,
...
...
@@ -70,16 +79,18 @@ class PayService
'order_price'
=>
$amount
,
'order_type'
=>
$orderType
,
'user_id'
=>
$userId
,
'subject'
=>
$
title
,
'subject'
=>
$
store
[
'title'
]
??
null
,
'req_info'
=>
json_encode
(
$reqInfo
,
JSON_UNESCAPED_UNICODE
),
'createtime'
=>
time
(),
'updatetime'
=>
time
(),
'expire_time'
=>
time
()
+
self
::
ORDER_TIMEOUT
// 2小时过期
'expire_time'
=>
time
()
+
self
::
ORDER_TIMEOUT
,
// 2小时过期
'store_user_id'
=>
$store
[
'user_id'
]
??
0
,
];
//如果是免费证书
if
(
$orderType
==
self
::
ORDER_TYPE_CERT
and
$amount
<=
0
)
{
$paymentData
[
'pay_status'
]
=
self
::
PAY_STATUS_SUCCESS
;
$paymentData
[
'pay_method'
]
=
3
;
self
::
handleBusinessAfterPayment
(
$paymentData
);
}
...
...
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