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
9d965f6e
Commit
9d965f6e
authored
Dec 01, 2025
by
yink
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复积分支付和订单取消逻辑问题
修复用户积分不足判断条件错误,由检查余额是否小于订单金额改为检查是否小于等于0 在组合支付订单取消时增加积分返还逻辑
parent
6b56fa63
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
app/Http/Controllers/Api/OrderController.php
+9
-1
app/Http/Controllers/Api/UserController.php
+3
-3
No files found.
app/Http/Controllers/Api/OrderController.php
View file @
9d965f6e
...
...
@@ -384,7 +384,7 @@ public function pay(Request $request)
}
//判断是否有足够的积分支付
if
(
$userObj
->
balance
<
$order_amount
)
{
if
(
$userObj
->
balance
<
=
0
)
{
return
$this
->
JsonResponse
(
''
,
'积分不足!'
,
500
);
}
...
...
@@ -533,6 +533,13 @@ public static function canceOrderFunc($order)
DB
::
commit
();
//未支付直接取消
Log
::
info
(
$order
->
id
);
//如果组合支付返还积分
if
(
$order
->
pay_type
==
3
)
{
//返还用户积分
UserPointChangeRec
::
pointChangeRecord
(
$order
->
user_id
,
$order
->
point_amount
,
1
,
4
,
1
,
$order
->
id
);
}
return
(
new
self
())
->
JsonResponse
(
''
);
}
...
...
@@ -724,6 +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
();
...
...
app/Http/Controllers/Api/UserController.php
View file @
9d965f6e
...
...
@@ -469,9 +469,9 @@ public function getMyFriend(Request $request)
$listData
=
$sql
->
offset
((
$page
-
1
)
*
$limit
)
->
limit
(
$limit
)
->
orderBy
(
'created_at'
,
'DESC'
)
->
get
();
if
(
$listData
->
toArray
())
{
foreach
(
$listData
as
$item
)
{
$divide_price
=
UserPointChangeRec
::
where
(
'change_type'
,
1
)
->
where
(
'point_state'
,
1
)
->
where
(
'source'
,
1
)
$divide_price
=
UserPointChangeRec
::
where
(
'change_type'
,
1
)
//增加
->
where
(
'point_state'
,
1
)
//已完成
->
where
(
'source'
,
$type
)
//直推or间推
->
whereHas
(
'order'
,
function
(
$query
)
use
(
$item
)
{
$query
->
where
(
'user_id'
,
$item
->
id
)
->
where
(
'pay_type'
,
1
)
...
...
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