Commit 30680353 by 杨树贤

修复数据

parent 69fa1cff
Showing with 23 additions and 0 deletions
......@@ -16,6 +16,7 @@ use App\Model\SpuBrandModel;
use App\Model\StandardBrandMappingModel;
use App\Model\StandardBrandModel;
use App\Model\SupplierAccountModel;
use App\Model\SupplierAddressModel;
use App\Model\SupplierAttachmentsModel;
use App\Model\SupplierChannelModel;
use App\Model\SupplierContactModel;
......@@ -547,7 +548,29 @@ class DataService
}, $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) {
$header = [
'供应商名字',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment