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
30680353
authored
Jun 13, 2024
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复数据
parent
69fa1cff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
app/Http/Services/DataService.php
app/Http/Services/DataService.php
View file @
30680353
...
@@ -16,6 +16,7 @@ use App\Model\SpuBrandModel;
...
@@ -16,6 +16,7 @@ use App\Model\SpuBrandModel;
use
App\Model\StandardBrandMappingModel
;
use
App\Model\StandardBrandMappingModel
;
use
App\Model\StandardBrandModel
;
use
App\Model\StandardBrandModel
;
use
App\Model\SupplierAccountModel
;
use
App\Model\SupplierAccountModel
;
use
App\Model\SupplierAddressModel
;
use
App\Model\SupplierAttachmentsModel
;
use
App\Model\SupplierAttachmentsModel
;
use
App\Model\SupplierChannelModel
;
use
App\Model\SupplierChannelModel
;
use
App\Model\SupplierContactModel
;
use
App\Model\SupplierContactModel
;
...
@@ -547,7 +548,29 @@ class DataService
...
@@ -547,7 +548,29 @@ class DataService
},
$supplierList
);
},
$supplierList
);
$suppliers
=
array_merge
(
$suppliers
,
$supplierList
);
$suppliers
=
array_merge
(
$suppliers
,
$supplierList
);
}
}
//再去匹配发货地址
$supplierIdAddr
=
SupplierAddressModel
::
where
(
'address'
,
'like'
,
"%
{
$keyword
}
%"
)
->
pluck
(
'supplier_id'
)
->
toArray
();
if
(
$supplierIdAddr
)
{
$supplierList
=
SupplierChannelModel
::
whereIn
(
'supplier_id'
,
$supplierIdAddr
)
->
select
([
'supplier_name'
,
'phone'
,
'supplier_address'
,
])
->
get
()
->
toArray
();
if
(
$supplierList
)
{
$supplierList
=
array_map
(
function
(
$supplier
)
use
(
$keyword
)
{
$supplier
[
'keyword'
]
=
$keyword
;
return
$supplier
;
},
$supplierList
);
$suppliers
=
array_merge
(
$suppliers
,
$supplierList
);
}
}
}
}
$idColumn
=
array_column
(
$suppliers
,
'supplier_name'
);
$idColumn
=
array_unique
(
$idColumn
);
$suppliers
=
array_intersect_key
(
$suppliers
,
$idColumn
);
Excel
::
create
(
'实体名单供应商导出'
,
function
(
$excel
)
use
(
$suppliers
)
{
Excel
::
create
(
'实体名单供应商导出'
,
function
(
$excel
)
use
(
$suppliers
)
{
$header
=
[
$header
=
[
'供应商名字'
,
'供应商名字'
,
...
...
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