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
87afbfb8
authored
Sep 28, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix
parent
1ed72a77
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
7 deletions
app/Http/Validators/SupplierAccountValidator.php
app/Http/Validators/SupplierValidator.php
app/Http/routes.php
app/Http/Validators/SupplierAccountValidator.php
View file @
87afbfb8
...
@@ -10,7 +10,6 @@ use Illuminate\Support\Facades\Validator;
...
@@ -10,7 +10,6 @@ use Illuminate\Support\Facades\Validator;
class
SupplierAccountValidator
class
SupplierAccountValidator
{
{
//保存相关的验证,别问我为什么不用laravel自带的form-request类
//保存相关的验证,别问我为什么不用laravel自带的form-request类
//因为控制器那边已经被之前的人魔改的难用的一比,而且控制器那边还接收了一大堆统一变量
public
function
checkSave
(
$request
)
public
function
checkSave
(
$request
)
{
{
//整理下请求数据
//整理下请求数据
...
@@ -33,15 +32,16 @@ class SupplierAccountValidator
...
@@ -33,15 +32,16 @@ class SupplierAccountValidator
if
(
$validator
->
fails
())
{
if
(
$validator
->
fails
())
{
return
$validator
->
errors
()
->
first
();
return
$validator
->
errors
()
->
first
();
}
}
$model
=
new
SupplierAccountModel
();
if
(
empty
(
$account
[
'id'
]))
{
if
(
empty
(
$account
[
'id'
]))
{
$supplierModel
=
new
SupplierChannelModel
();
$supplierModel
=
new
SupplierChannelModel
();
$yunxinChannelUid
=
$supplierModel
->
where
(
'supplier_code'
,
$yunxinChannelUid
=
$supplierModel
->
where
(
$account
[
'supplier_code'
])
->
value
(
'yunxin_channel_uid'
);
'supplier_code'
,
$account
[
'supplier_code'
]
)
->
value
(
'yunxin_channel_uid'
);
if
(
empty
(
$yunxinChannelUid
))
{
if
(
empty
(
$yunxinChannelUid
))
{
//return '该供应商没有绑定SKU采购,请完善相关信息';
//return '该供应商没有绑定SKU采购,请完善相关信息';
}
}
$model
=
new
SupplierAccountModel
();
$supplierCount
=
$model
->
where
(
'supplier_code'
,
$account
[
'supplier_code'
])
$supplierCount
=
$model
->
where
(
'supplier_code'
,
$account
[
'supplier_code'
])
->
count
();
->
count
();
if
(
$supplierCount
>
0
)
{
if
(
$supplierCount
>
0
)
{
...
@@ -52,6 +52,13 @@ class SupplierAccountValidator
...
@@ -52,6 +52,13 @@ class SupplierAccountValidator
if
(
$mobileCount
>
0
)
{
if
(
$mobileCount
>
0
)
{
return
'该手机号已经被注册'
;
return
'该手机号已经被注册'
;
}
}
}
else
{
$supplierCount
=
$model
->
where
(
'id'
,
'!='
,
$account
[
'id'
])
->
where
(
'supplier_code'
,
$account
[
'supplier_code'
])
->
count
();
if
(
$supplierCount
>
0
)
{
return
'该供应商已经存在账号'
;
}
}
}
return
true
;
return
true
;
...
...
app/Http/Validators/SupplierValidator.php
View file @
87afbfb8
...
@@ -101,6 +101,13 @@ class SupplierValidator
...
@@ -101,6 +101,13 @@ class SupplierValidator
return
null
;
return
null
;
}
}
if
(
empty
(
$supplierId
))
{
$count
=
SupplierChannelModel
::
where
(
'supplier_name'
,
$validateData
[
'supplier_name'
])
->
count
();
if
(
$count
)
{
return
"该供应商名称已经存在,请核验后再提交"
;
}
}
$rules
=
[
$rules
=
[
'supplier_type'
=>
'required'
,
'supplier_type'
=>
'required'
,
'supplier_name'
=>
'required'
,
'supplier_name'
=>
'required'
,
...
...
app/Http/routes.php
View file @
87afbfb8
...
@@ -96,8 +96,7 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
...
@@ -96,8 +96,7 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
});
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
SupplierAccountService
::
autoCreateYunxinAccount
(
18708
);
SupplierChannelModel
::
where
(
'supplier_id'
,
'18715'
)
->
delete
();
// DataService::initSupplierNationId();
// DataService::initSupplierReceiptNationId();
// DataService::initSupplierReceiptNationId();
// SupplierAccountService::initYunxinAccountName();
// SupplierAccountService::initYunxinAccountName();
// DataService::syncSupplierToErp();
// DataService::syncSupplierToErp();
...
...
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