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
a7203e5e
authored
May 17, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
导出需要下架商品的供应商
parent
1fea53c3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
app/Http/Services/DataService.php
app/Http/routes.php
app/Http/Services/DataService.php
View file @
a7203e5e
...
...
@@ -1117,7 +1117,7 @@ class DataService
//供应商性质为“分销平台”的有上传过sku的供应商
$excelData
=
[];
$uploadedSkuSuppliers
=
SupplierChannelModel
::
where
(
'supplier_group'
,
5
)
->
where
(
'is_type'
,
0
)
->
where
(
'uploaded_sku'
,
1
)
->
get
()
->
toArray
();
->
where
(
'is_type'
,
0
)
->
where
(
'uploaded_sku'
,
1
)
->
get
()
->
toArray
();
foreach
(
$uploadedSkuSuppliers
as
$supplier
)
{
$supplier
=
SupplierChannelModel
::
where
(
'supplier_code'
,
$supplier
[
'supplier_code'
])
->
first
();
if
(
empty
(
$supplier
))
{
...
...
@@ -1140,4 +1140,21 @@ class DataService
});
})
->
store
(
'csv'
);
}
//获取非原厂,非api对接的,有sku的正式供应商列表
public
function
getOffShelfSupplierList
()
{
$suppliers
=
SupplierChannelModel
::
where
(
'sku_num'
,
'>'
,
0
)
->
where
(
'supplier_group'
,
'!='
,
4
)
->
where
(
'is_type'
,
0
)
->
get
()
->
toArray
();
$supplierList
=
[];
foreach
(
$suppliers
as
$supplier
)
{
$isApiSupplier
=
DataManageModel
::
where
(
'canal'
,
$supplier
[
'supplier_code'
])
->
where
(
'is_type'
,
0
)
->
exist
();
if
(
$isApiSupplier
)
{
continue
;
}
$supplierList
[]
=
$supplier
[
'code'
];
}
echo
json_encode
(
$supplierList
);
}
}
\ No newline at end of file
app/Http/routes.php
View file @
a7203e5e
...
...
@@ -67,7 +67,7 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
(
new
\App\Http\Services\DataService
())
->
exportSupplierBySourceType
();
(
new
\App\Http\Services\DataService
())
->
getOffShelfSupplierList
();
// \App\Model\SupplierChannelModel::where('supplier_name', '深圳市金开盛电子有限公司')->update([
// 'status' => 2,
// 'update_time' => time(),
...
...
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