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
856f51c6
authored
Jun 23, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
供应商名称校验白名单
parent
1b3d7409
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
app/Http/Validators/SupplierValidator.php
config/field.php
app/Http/Validators/SupplierValidator.php
View file @
856f51c6
...
...
@@ -35,6 +35,10 @@ class SupplierValidator
}
else
{
$count
=
SupplierChannelModel
::
where
(
'supplier_name'
,
$validateData
[
'supplier_name'
])
->
where
(
'supplier_id'
,
'!='
,
$supplierId
)
->
count
();
//特殊处理下一些已经重复的供应商,历史数据问题
if
(
in_array
(
$supplierId
,
config
(
'field.NeedSkipSupplierNameCheckIds'
)))
{
$count
=
0
;
}
}
if
(
$count
)
{
return
"该供应商名称已经存在,请核验后再提交"
;
...
...
@@ -212,6 +216,10 @@ class SupplierValidator
}
else
{
$count
=
SupplierChannelModel
::
where
(
'supplier_name'
,
$validateData
[
'supplier_name'
])
->
where
(
'supplier_id'
,
'!='
,
$supplierId
)
->
count
();
//特殊处理下一些已经重复的供应商,历史数据问题
if
(
in_array
(
$supplierId
,
config
(
'field.NeedSkipSupplierNameCheckIds'
)))
{
$count
=
0
;
}
}
if
(
$count
)
{
$errorMessageList
[]
=
"该供应商名称已经存在,请核验后再提交"
;
...
...
config/field.php
View file @
856f51c6
...
...
@@ -132,5 +132,10 @@ return [
1
=>
'人工上传'
,
2
=>
'API对接'
,
3
=>
'云芯上传'
],
//需要跳过重复校验的供应商ID
'NeedSkipSupplierNameCheckIds'
=>
[
195
,
12263
]
];
\ No newline at end of file
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