Commit 856f51c6 by 杨树贤

供应商名称校验白名单

parent 1b3d7409
...@@ -35,6 +35,10 @@ class SupplierValidator ...@@ -35,6 +35,10 @@ class SupplierValidator
} else { } else {
$count = SupplierChannelModel::where('supplier_name', $validateData['supplier_name']) $count = SupplierChannelModel::where('supplier_name', $validateData['supplier_name'])
->where('supplier_id', '!=', $supplierId)->count(); ->where('supplier_id', '!=', $supplierId)->count();
//特殊处理下一些已经重复的供应商,历史数据问题
if (in_array($supplierId, config('field.NeedSkipSupplierNameCheckIds'))) {
$count = 0;
}
} }
if ($count) { if ($count) {
return "该供应商名称已经存在,请核验后再提交"; return "该供应商名称已经存在,请核验后再提交";
...@@ -212,6 +216,10 @@ class SupplierValidator ...@@ -212,6 +216,10 @@ class SupplierValidator
} else { } else {
$count = SupplierChannelModel::where('supplier_name', $validateData['supplier_name']) $count = SupplierChannelModel::where('supplier_name', $validateData['supplier_name'])
->where('supplier_id', '!=', $supplierId)->count(); ->where('supplier_id', '!=', $supplierId)->count();
//特殊处理下一些已经重复的供应商,历史数据问题
if (in_array($supplierId, config('field.NeedSkipSupplierNameCheckIds'))) {
$count = 0;
}
} }
if ($count) { if ($count) {
$errorMessageList[] = "该供应商名称已经存在,请核验后再提交"; $errorMessageList[] = "该供应商名称已经存在,请核验后再提交";
......
...@@ -132,5 +132,10 @@ return [ ...@@ -132,5 +132,10 @@ return [
1 => '人工上传', 1 => '人工上传',
2 => 'API对接', 2 => 'API对接',
3 => '云芯上传' 3 => '云芯上传'
],
//需要跳过重复校验的供应商ID
'NeedSkipSupplierNameCheckIds' => [
195,
12263
] ]
]; ];
\ No newline at end of file
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