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
3c5bd95f
authored
Jul 07, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
编辑操作不去校验供应商是否存在,因为无法修改
parent
f2d5e764
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
29 deletions
app/Http/Controllers/Api/SupplierApiController.php
app/Http/Validators/SupplierValidator.php
config/field.php
app/Http/Controllers/Api/SupplierApiController.php
View file @
3c5bd95f
...
@@ -298,9 +298,6 @@ class SupplierApiController extends Controller
...
@@ -298,9 +298,6 @@ class SupplierApiController extends Controller
//如果是编辑操作,则要忽略非当前
//如果是编辑操作,则要忽略非当前
if
(
$supplierId
)
{
if
(
$supplierId
)
{
if
(
in_array
(
$supplierId
,
config
(
'field.NeedSkipSupplierNameCheckIds'
)))
{
$this
->
response
(
0
,
'供应商名称合理'
);
}
$originSupplierName
=
$model
->
where
(
'supplier_id'
,
$supplierId
)
->
value
(
'supplier_name'
);
$originSupplierName
=
$model
->
where
(
'supplier_id'
,
$supplierId
)
->
value
(
'supplier_name'
);
$existedSupplierName
=
$model
->
where
(
'supplier_name'
,
$supplierName
)
->
where
(
'supplier_name'
,
'!='
,
$existedSupplierName
=
$model
->
where
(
'supplier_name'
,
$supplierName
)
->
where
(
'supplier_name'
,
'!='
,
$originSupplierName
)
$originSupplierName
)
...
...
app/Http/Validators/SupplierValidator.php
View file @
3c5bd95f
...
@@ -68,12 +68,8 @@ class SupplierValidator
...
@@ -68,12 +68,8 @@ class SupplierValidator
}
}
$count
=
SupplierChannelModel
::
where
(
'supplier_name'
,
$validateData
[
'supplier_name'
])
->
count
();
$count
=
SupplierChannelModel
::
where
(
'supplier_name'
,
$validateData
[
'supplier_name'
])
->
count
();
}
else
{
}
else
{
$count
=
SupplierChannelModel
::
where
(
'supplier_name'
,
$validateData
[
'supplier_name'
])
//对接一体化以后,名称不能修改了,所以直接为0
->
where
(
'supplier_id'
,
'!='
,
$supplierId
)
->
count
();
$count
=
0
;
//特殊处理下一些已经重复的供应商,历史数据问题
if
(
in_array
(
$supplierId
,
config
(
'field.NeedSkipSupplierNameCheckIds'
)))
{
$count
=
0
;
}
}
}
if
(
$count
)
{
if
(
$count
)
{
return
"该供应商名称已经存在,请核验后再提交"
;
return
"该供应商名称已经存在,请核验后再提交"
;
...
@@ -276,12 +272,8 @@ class SupplierValidator
...
@@ -276,12 +272,8 @@ class SupplierValidator
$companyNameCount
=
SupplierChannelModel
::
where
(
'register_company_name'
,
$companyNameCount
=
SupplierChannelModel
::
where
(
'register_company_name'
,
$validateData
[
'register_company_name'
])
->
where
(
'register_company_name'
,
'!='
,
''
)
->
count
();
$validateData
[
'register_company_name'
])
->
where
(
'register_company_name'
,
'!='
,
''
)
->
count
();
}
else
{
}
else
{
$count
=
SupplierChannelModel
::
where
(
'supplier_name'
,
$validateData
[
'supplier_name'
])
//对接一体化以后,名称不能修改了,所以直接为0
->
where
(
'supplier_id'
,
'!='
,
$supplierId
)
->
count
();
$count
=
0
;
//特殊处理下一些已经重复的供应商,历史数据问题
if
(
in_array
(
$supplierId
,
config
(
'field.NeedSkipSupplierNameCheckIds'
)))
{
$count
=
0
;
}
}
}
if
(
$count
)
{
if
(
$count
)
{
$errorMessageList
[]
=
"该供应商名称已经存在,请核验后再提交"
;
$errorMessageList
[]
=
"该供应商名称已经存在,请核验后再提交"
;
...
...
config/field.php
View file @
3c5bd95f
...
@@ -179,18 +179,5 @@ return [
...
@@ -179,18 +179,5 @@ return [
'分销平台'
=>
'分销平台'
,
'分销平台'
=>
'分销平台'
,
'代工厂'
=>
'代工厂'
,
'代工厂'
=>
'代工厂'
,
],
],
//需要跳过重复校验的供应商ID
'NeedSkipSupplierNameCheckIds'
=>
[
2619
,
7443
,
195
,
12263
,
4983
,
33
,
3454
,
2895
,
3299
,
4634
],
'NeedCheckCompanyRegion'
=>
[
2
,
4
]
'NeedCheckCompanyRegion'
=>
[
2
,
4
]
];
];
\ 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