Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
service
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
aimeiyue
service
Commits
3132c617
Commit
3132c617
authored
Dec 18, 2025
by
yink
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(OrderController): 修复订单信息查询支持订单号和ID两种方式
原代码仅支持通过订单ID查询,现增加通过订单号查询功能。当同时缺少订单ID和订单号时返回参数错误,查询不到订单时返回更明确的错误信息。
parent
9d965f6e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
app/Http/Controllers/Api/OrderController.php
+14
-6
No files found.
app/Http/Controllers/Api/OrderController.php
View file @
3132c617
...
...
@@ -323,14 +323,14 @@ public function pay(Request $request)
$pay_type
=
$request
->
pay_type
;
//支付方式 1:微信 2:积分 3:混合
if
(
$order
->
pay_cs
>
0
)
{
//第二次支付不用选择,从订单查询支付方式,
//第二次支付不用选择,从订单查询支付方式,
2
$pay_type
=
$order
->
pay_type
;
if
(
$pay_type
==
'3'
)
{
//混合支付后的二次支付,不用在扣除余额了
$pay_type
=
4
;
}
}
else
{
if
(
!
in_array
(
$pay_type
,
[
1
,
2
,
3
]))
{
return
$this
->
JsonResponse
(
''
,
'请选择支付方式'
,
500
);
}
...
...
@@ -731,7 +731,7 @@ public function scanCodeVerifi(Request $request)
$orderObj
->
shipping_goods
=
$ogItem
->
shipping_goods
;
$orderObj
->
shipping_at
=
date
(
"Y-m-d H:i:s"
);
//更新订单状态为解冻中,解冻7天(汇付会冻结1天),到期后分发佣金
$orderObj
->
freeze_end_date
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
'+6 day'
));
$orderObj
->
save
();
...
...
@@ -810,9 +810,17 @@ public function scanCodeDetail(Request $request)
public
function
OrderInfo
(
Request
$request
)
{
$order_id
=
$request
->
order_id
??
0
;
$orderObj
=
OrderInfoModel
::
find
(
$order_id
);
$order_sn
=
$request
->
order_sn
??
''
;
if
(
!
$order_id
&&
!
$order_sn
)
{
return
$this
->
JsonResponse
(
''
,
'参数错误02'
,
201
);
}
else
if
(
$order_id
)
{
$orderObj
=
OrderInfoModel
::
find
(
$order_id
);
}
else
if
(
$order_sn
)
{
$orderObj
=
OrderInfoModel
::
where
(
'order_sn'
,
$order_sn
)
->
first
();
}
if
(
!
$orderObj
)
{
return
$this
->
JsonResponse
(
''
,
'
参数错误
'
,
201
);
return
$this
->
JsonResponse
(
''
,
'
订单不存在
'
,
201
);
}
...
...
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