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
35bad2ca
authored
Aug 24, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
附件认证规则修改
parent
6ee1e46f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
1 deletions
app/Http/Controllers/Api/CommonApiController.php
app/Http/Validators/SupplierValidator.php
app/Http/Controllers/Api/CommonApiController.php
View file @
35bad2ca
...
...
@@ -6,6 +6,7 @@ use App\Http\Controllers\Controller;
use
App\Http\Services\AdminUserService
;
use
App\Model\BrandModel
;
use
App\Model\SelfClassifyModel
;
use
App\Model\StandardBrandModel
;
use
Illuminate\Http\Request
;
use
GuzzleHttp\Client
;
use
Illuminate\Support\Facades\DB
;
...
...
@@ -45,6 +46,31 @@ class CommonApiController extends Controller
return
$this
->
response
(
0
,
'ok'
,
$brandList
);
}
//搜索标准品牌
public
function
SearchStandardBrand
(
$request
)
{
$brandName
=
$request
->
input
(
'brand_name'
);
$standardBrandModel
=
new
StandardBrandModel
();
$query
=
$standardBrandModel
->
where
(
'status'
,
1
);
if
(
$brandName
)
{
$query
=
$query
->
where
(
'brand_name'
,
'like'
,
$brandName
.
'%'
);
}
$count
=
$query
->
count
();
$list
=
$query
->
select
(
'brand_name'
,
'brand_id'
)
->
paginate
(
17
);
$list
=
$list
?
$list
->
toArray
()
:
[];
$data
=
array_get
(
$list
,
'data'
);
$lastPage
=
array_get
(
$list
,
'last_page'
);
echo
json_encode
([
'errcode'
=>
0
,
'errmsg'
=>
'ok'
,
'total'
=>
$count
,
'count'
=>
$count
,
'data'
=>
$data
,
'last_page'
=>
$lastPage
]);
}
private
function
SearchBrand
(
$request
)
{
$brandName
=
$request
->
input
(
'brand_name'
);
...
...
app/Http/Validators/SupplierValidator.php
View file @
35bad2ca
...
...
@@ -32,7 +32,7 @@ class SupplierValidator
'return_address'
=>
'max:100'
,
'return_consignee'
=>
'max:50'
,
'return_phone'
=>
'max:50'
,
'business_license'
=>
'required'
,
//
'business_license' => 'required',
// 'established_time' => 'required',
'cn_ratio'
=>
'min:1'
,
'us_ratio'
=>
'min:1'
,
...
...
@@ -45,6 +45,19 @@ class SupplierValidator
'supplier_position'
=>
'required|max:30'
,
'can_check_uids'
=>
'required'
,
];
//校验附件,只要营业执照、商业登记证、公司注册证至少其中一个上传了附件,就判定已经上传了附件
$attachmentValidateFields
=
[
'business_license'
,
'registration_certificate'
,
'incorporation_certificate'
];
$attachmentValidateFieldsExist
=
false
;
foreach
(
$attachmentValidateFields
as
$field
)
{
if
(
array_get
(
$requestData
,
$field
))
{
$attachmentValidateFieldsExist
=
true
;
break
;
}
}
if
(
!
$attachmentValidateFieldsExist
)
{
return
'附件里营业执照、商业登记证、公司注册证至少要上传一个'
;
}
//第一次新增的时候,是要校验联系人的
if
(
empty
(
$requestData
[
'supplier_id'
]))
{
$rules
=
array_merge
(
$rules
,
$contactRuler
);
...
...
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