Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
liexin_supplier
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f72f14c2
authored
Mar 02, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
语法问题
parent
ae12bf26
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
10 deletions
app/Console/Commands/RefreshHistoryPurchaseUser.php
app/Console/Commands/RefreshHistoryPurchaseUser.php
View file @
f72f14c2
...
...
@@ -41,8 +41,9 @@ class RefreshHistoryPurchaseUser extends Command
$this
->
info
(
'========================================'
);
// 调用服务方法
$result
=
SupplierService
::
refreshHistoryPurchaseUserWithProgress
(
$mode
,
$num
,
function
(
$progress
)
{
$this
->
outputProgress
(
$progress
);
$self
=
$this
;
$result
=
SupplierService
::
refreshHistoryPurchaseUserWithProgress
(
$mode
,
$num
,
function
(
$progress
)
use
(
$self
)
{
$self
->
outputProgress
(
$progress
);
});
// 输出最终结果
...
...
@@ -60,11 +61,14 @@ class RefreshHistoryPurchaseUser extends Command
$this
->
info
(
''
);
$this
->
warn
(
'失败/跳过详情:'
);
foreach
(
$result
[
'debug_info'
]
as
$info
)
{
$failReason
=
isset
(
$info
[
'fail_reason'
])
?
$info
[
'fail_reason'
]
:
''
;
$skipReason
=
isset
(
$info
[
'skip_reason'
])
?
$info
[
'skip_reason'
]
:
''
;
$supplierName
=
isset
(
$info
[
'supplier_name'
])
?
$info
[
'supplier_name'
]
:
''
;
$this
->
warn
(
sprintf
(
' [ID:%d] %s - %s'
,
$info
[
'supplier_id'
],
$
info
[
'supplier_name'
]
??
''
,
$
info
[
'fail_reason'
]
??
$info
[
'skip_reason'
]
??
''
$
supplierName
,
$
failReason
?
$failReason
:
$skipReason
));
}
}
...
...
@@ -78,19 +82,27 @@ class RefreshHistoryPurchaseUser extends Command
private
function
outputProgress
(
$progress
)
{
$supplierId
=
$progress
[
'supplier_id'
];
$supplierName
=
$progress
[
'supplier_name'
]
;
$action
=
$progress
[
'action'
]
??
''
;
$status
=
$progress
[
'status'
]
??
''
;
$supplierName
=
isset
(
$progress
[
'supplier_name'
])
?
$progress
[
'supplier_name'
]
:
''
;
$action
=
isset
(
$progress
[
'action'
])
?
$progress
[
'action'
]
:
''
;
$status
=
isset
(
$progress
[
'status'
])
?
$progress
[
'status'
]
:
''
;
$statusIcon
=
$status
===
'success'
?
'
✓'
:
(
$status
===
'skip'
?
'-'
:
'✗
'
);
$statusIcon
=
$status
===
'success'
?
'
OK'
:
(
$status
===
'skip'
?
'--'
:
'XX
'
);
$statusColor
=
$status
===
'success'
?
'info'
:
(
$status
===
'skip'
?
'comment'
:
'error'
);
$
this
->
$statusColor
(
sprintf
(
$
message
=
sprintf
(
' [%s] ID:%d %s - %s'
,
$statusIcon
,
$supplierId
,
$supplierName
,
$action
));
);
if
(
$statusColor
===
'info'
)
{
$this
->
info
(
$message
);
}
elseif
(
$statusColor
===
'comment'
)
{
$this
->
comment
(
$message
);
}
else
{
$this
->
error
(
$message
);
}
}
}
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