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
4eab16dc
Commit
4eab16dc
authored
Jul 20, 2026
by
刘小敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add auto order requeue fix script
新增脚本用于手动重新推送自动确认收货和自动评价的队列任务,支持指定模式执行,内置了测试订单ID列表,包含合法性校验和执行日志输出。
parent
bdd6d174
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
88 additions
and
0 deletions
+88
-0
requeue_auto_order_fix.php
requeue_auto_order_fix.php
+88
-0
No files found.
requeue_auto_order_fix.php
0 → 100644
View file @
4eab16dc
<?php
define
(
'APP_PATH'
,
__DIR__
.
'/../application/'
);
require
__DIR__
.
'/../thinkphp/base.php'
;
\think\App
::
initCommon
();
use
think\Queue
;
use
app\admin\model\shopro\order\Order
;
use
app\admin\model\shopro\order\OrderItem
;
$mode
=
$argv
[
1
]
??
''
;
if
(
!
in_array
(
$mode
,
[
'confirm'
,
'comment'
],
true
))
{
echo
"Usage:
\n
"
;
echo
" php runtime/requeue_auto_order_fix.php confirm
\n
"
;
echo
" php runtime/requeue_auto_order_fix.php comment
\n
"
;
exit
(
1
);
}
$confirmOrderIds
=
[
22
,
24
,
25
];
$commentOrderIds
=
[
22
,
24
,
25
,
27
];
if
(
$mode
===
'confirm'
)
{
foreach
(
$confirmOrderIds
as
$orderId
)
{
$order
=
Order
::
paid
()
->
where
(
'id'
,
$orderId
)
->
find
();
if
(
!
$order
)
{
echo
"[skip confirm] order
{
$orderId
}
not found or not paid
\n
"
;
continue
;
}
$items
=
OrderItem
::
where
(
'order_id'
,
$orderId
)
->
select
();
if
(
!
$items
||
count
(
$items
)
<=
0
)
{
echo
"[skip confirm] order
{
$orderId
}
has no items
\n
"
;
continue
;
}
Queue
::
push
(
'\\addons\\shopro\\job\\OrderAutoOper@autoConfirm'
,
[
'order'
=>
$order
->
toArray
(),
'items'
=>
collection
(
$items
)
->
toArray
(),
],
'shopro'
);
echo
"[queued confirm] order
{
$orderId
}
, items="
.
count
(
$items
)
.
"
\n
"
;
}
exit
(
0
);
}
if
(
$mode
===
'comment'
)
{
foreach
(
$commentOrderIds
as
$orderId
)
{
$order
=
Order
::
paid
()
->
where
(
'id'
,
$orderId
)
->
find
();
if
(
!
$order
)
{
echo
"[skip comment] order
{
$orderId
}
not found or not paid
\n
"
;
continue
;
}
$items
=
OrderItem
::
where
(
'order_id'
,
$orderId
)
->
select
();
if
(
!
$items
||
count
(
$items
)
<=
0
)
{
echo
"[skip comment] order
{
$orderId
}
has no items
\n
"
;
continue
;
}
foreach
(
$items
as
$item
)
{
Queue
::
push
(
'\\addons\\shopro\\job\\OrderAutoOper@autoComment'
,
[
'order'
=>
$order
->
toArray
(),
'item'
=>
$item
->
toArray
(),
],
'shopro'
);
echo
"[queued comment] order
{
$orderId
}
, item
{
$item
->
id
}
\n
"
;
}
}
exit
(
0
);
}
\ 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