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
4dad90cf
authored
Jun 17, 2024
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
银行账号优化
parent
30680353
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
6 deletions
app/Http/Services/DataService.php
app/Http/Services/SupplierReceiptService.php
app/Http/Validators/ReceiptValidator.php
app/Http/routes.php
app/Http/Services/DataService.php
View file @
4dad90cf
...
...
@@ -20,6 +20,7 @@ use App\Model\SupplierAddressModel;
use
App\Model\SupplierAttachmentsModel
;
use
App\Model\SupplierChannelModel
;
use
App\Model\SupplierContactModel
;
use
App\Model\SupplierReceiptModel
;
use
App\Model\UserInfoModel
;
use
Carbon\Carbon
;
use
GuzzleHttp\Client
;
...
...
@@ -596,5 +597,15 @@ class DataService
}
public
static
function
checkSupplierBandAccount
()
{
ini_set
(
'memory_limit'
,
-
1
);
$accounts
=
SupplierReceiptModel
::
select
([
'account_no'
,
'supplier_id'
])
->
get
()
->
toArray
();
foreach
(
$accounts
as
$account
)
{
if
(
!
SupplierReceiptService
::
isOnlyDigitsAndHyphen
(
$account
[
'account_no'
]))
{
dump
(
$account
[
'account_no'
]);
}
}
}
}
app/Http/Services/SupplierReceiptService.php
View file @
4dad90cf
...
...
@@ -11,5 +11,7 @@ use App\Model\SupplierContactModel;
class
SupplierReceiptService
{
}
\ No newline at end of file
public
static
function
isOnlyDigitsAndHyphen
(
$str
)
{
return
preg_match
(
"/^[0-9\-]*$/"
,
$str
);
}
}
app/Http/Validators/ReceiptValidator.php
View file @
4dad90cf
...
...
@@ -10,7 +10,7 @@ class ReceiptValidator
{
//保存相关的验证,别问我为什么不用laravel自带的form-request类
//因为控制器那边已经被之前的人魔改的难用的一比,而且控制器那边还接收了一大堆统一变量
public
function
checkSave
(
$data
,
$returnAllError
=
false
)
public
function
checkSave
(
$data
,
$returnAllError
=
false
)
{
$receipt
=
$data
;
//整理下请求数据
...
...
@@ -18,6 +18,7 @@ class ReceiptValidator
"bank_name"
=>
"required"
,
"bank_adderss"
=>
"required"
,
"account_no"
=>
"required"
,
//"account_no" => "required|regex:/^[0-9\-]+$/",
"receipt_type"
=>
'required'
,
"certificate"
=>
"required"
,
];
...
...
@@ -34,7 +35,7 @@ class ReceiptValidator
if
(
$validator
->
fails
())
{
if
(
$returnAllError
)
{
return
$validator
->
errors
()
->
all
();
}
else
{
}
else
{
return
$validator
->
errors
()
->
first
();
}
}
...
...
app/Http/routes.php
View file @
4dad90cf
...
...
@@ -82,5 +82,5 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
(
new
\App\Http\Services\DataService
())
->
exportSupplier
();
(
new
\App\Http\Services\DataService
())
->
checkSupplierBandAccount
();
});
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