Commit 5a04ffca by 杨树贤

本地限制查看供应商

parent 052742fd
...@@ -104,6 +104,9 @@ class SupplierFilter ...@@ -104,6 +104,9 @@ class SupplierFilter
} }
//默认过滤带有-1字符串的供应商名称的数据 //默认过滤带有-1字符串的供应商名称的数据
$query->whereRaw('supplier_name NOT LIKE "%-1"'); $query->whereRaw('supplier_name NOT LIKE "%-1"');
if (config('website.domain') == 'liexin.net') {
$query->where('supplier_id', '>', 12211);
}
return $query; return $query;
} }
......
...@@ -250,14 +250,18 @@ class DataService ...@@ -250,14 +250,18 @@ class DataService
$suppliers = []; $suppliers = [];
try { try {
Excel::selectSheetsByIndex(0)->load($filePath, function ($reader) { Excel::selectSheetsByIndex(0)->load($filePath, function ($reader) {
$reader->sheet('Sheet1', function () use ($reader) { $reader->sheet('QC不良记录', function () use ($reader) {
$supplierModel = new SupplierChannelModel(); $supplierModel = new SupplierChannelModel();
dd($reader->all()->toArray());
foreach ($reader->all()->toArray() as $key => $item) { foreach ($reader->all()->toArray() as $key => $item) {
$supplierName = trim($item[0]); if ($key == 0 || $key == 1) {
continue;
}
$supplierName = trim($item[2]);
if (empty($supplierName)) { if (empty($supplierName)) {
continue; continue;
} }
$supplier = $supplierModel->where('supplier_name',$supplierName)->first(); $supplier = $supplierModel->where('supplier_name', $supplierName)->first();
if (!empty($supplier)) { if (!empty($supplier)) {
$suppliers[] = $supplier->toArray(); $suppliers[] = $supplier->toArray();
} }
...@@ -267,7 +271,8 @@ class DataService ...@@ -267,7 +271,8 @@ class DataService
foreach ($suppliers as $supplier) { foreach ($suppliers as $supplier) {
$supplierId = $supplier['supplier_id']; $supplierId = $supplier['supplier_id'];
$oldTags = $supplier['system_tags']; $oldTags = $supplier['system_tags'];
$newTags = $supplier['system_tags'] ? rtrim($supplier['system_tags'], ',') . ',历史检测异常' : '历史检测异常'; $newTags = $supplier['system_tags'] ? rtrim($supplier['system_tags'],
',') . ',历史检测异常' : '历史检测异常';
if ($tagService->saveTags($supplierId, 14, $newTags, $oldTags)) { if ($tagService->saveTags($supplierId, 14, $newTags, $oldTags)) {
$supplierModel->where('supplier_id', $supplierId)->update([ $supplierModel->where('supplier_id', $supplierId)->update([
'system_tags' => $newTags 'system_tags' => $newTags
...@@ -462,7 +467,7 @@ class DataService ...@@ -462,7 +467,7 @@ class DataService
//转移付款方式到新添加的付款方式 //转移付款方式到新添加的付款方式
public function TransferPayTypeDataToNewTable() public function TransferPayTypeDataToNewTable()
{ {
ini_set('memory_limit','-1'); ini_set('memory_limit', '-1');
$suppliers = SupplierChannelModel::where('pay_type', '!=', '0')->get()->toArray(); $suppliers = SupplierChannelModel::where('pay_type', '!=', '0')->get()->toArray();
$payTypeData = []; $payTypeData = [];
foreach ($suppliers as $supplier) { foreach ($suppliers as $supplier) {
......
This diff could not be displayed because it is too large.
No preview for this file type
[ZoneTransfer]
[ZoneTransfer]
ZoneId=3
ReferrerUrl=https://www.tapd.cn/
HostUrl=https://file.tapd.cn/56056445/attachments/download/1156056445001001663/story
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