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
444173c4
authored
Mar 02, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix
parent
dcbbb4b5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
18 deletions
app/Console/Commands/SyncSupplierToErp.php
app/Console/Commands/SyncSupplierToErp.php
View file @
444173c4
...
@@ -14,7 +14,7 @@ class SyncSupplierToErp extends Command
...
@@ -14,7 +14,7 @@ class SyncSupplierToErp extends Command
*
*
* @var string
* @var string
*/
*/
protected
$signature
=
'sync:supplier_to_erp
{--num=0 : 处理数量限制(0=不限制)}
'
;
protected
$signature
=
'sync:supplier_to_erp'
;
/**
/**
* The console command description.
* The console command description.
...
@@ -30,29 +30,21 @@ class SyncSupplierToErp extends Command
...
@@ -30,29 +30,21 @@ class SyncSupplierToErp extends Command
*/
*/
public
function
handle
()
public
function
handle
()
{
{
$num
=
(
int
)
$this
->
option
(
'num'
);
ini_set
(
'memory_limit'
,
-
1
);
ini_set
(
'memory_limit'
,
-
1
);
set_time_limit
(
0
);
set_time_limit
(
0
);
ignore_user_abort
(
true
);
ob_implicit_flush
(
true
);
$this
->
info
(
'========================================'
);
$this
->
info
(
'========================================'
);
$this
->
info
(
'开始同步供应商到ERP'
);
$this
->
info
(
'开始同步供应商到ERP'
);
$this
->
info
(
'处理数量: '
.
(
$num
>
0
?
$num
:
'不限制'
));
$this
->
info
(
'========================================'
);
$this
->
info
(
'========================================'
);
// 构建查询:yunxin_channel_uid不为空且不为0
$suppliers
=
SupplierChannelModel
::
where
(
'is_type'
,
0
)
$query
=
SupplierChannelModel
::
where
(
'is_type'
,
0
)
->
where
(
'yunxin_channel_uid'
,
'!='
,
''
)
->
get
();
->
where
(
'yunxin_channel_uid'
,
'!='
,
''
);
$suppliers
=
$query
->
get
();
$total
=
count
(
$suppliers
);
$total
=
count
(
$suppliers
);
$this
->
info
(
"共找到
{
$total
}
个供应商需要同步"
);
$this
->
info
(
"共找到
{
$total
}
个供应商需要同步"
);
$syncService
=
new
SyncSupplierService
();
$syncService
=
new
SyncSupplierService
();
$success
=
0
;
$success
=
0
;
$failed
=
0
;
$count
=
0
;
$count
=
0
;
foreach
(
$suppliers
as
$supplier
)
{
foreach
(
$suppliers
as
$supplier
)
{
...
@@ -65,13 +57,6 @@ class SyncSupplierToErp extends Command
...
@@ -65,13 +57,6 @@ class SyncSupplierToErp extends Command
echo
"成功
\n
"
;
echo
"成功
\n
"
;
}
}
$this
->
info
(
'========================================'
);
$this
->
info
(
'处理完成'
);
$this
->
info
(
'总计: '
.
$total
);
$this
->
info
(
'成功: '
.
$success
);
$this
->
info
(
'失败: '
.
$failed
);
$this
->
info
(
'========================================'
);
return
0
;
return
0
;
}
}
}
}
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