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
e77eb752
authored
Jun 17, 2024
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修改逻辑
parent
4dad90cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
app/Http/Services/DataService.php
app/Http/Services/SupplierReceiptService.php
app/Http/Services/DataService.php
View file @
e77eb752
...
@@ -604,6 +604,8 @@ class DataService
...
@@ -604,6 +604,8 @@ class DataService
foreach
(
$accounts
as
$account
)
{
foreach
(
$accounts
as
$account
)
{
if
(
!
SupplierReceiptService
::
isOnlyDigitsAndHyphen
(
$account
[
'account_no'
]))
{
if
(
!
SupplierReceiptService
::
isOnlyDigitsAndHyphen
(
$account
[
'account_no'
]))
{
dump
(
$account
[
'account_no'
]);
dump
(
$account
[
'account_no'
]);
$accountNo
=
SupplierReceiptService
::
keepOnlyDigitsAndHyphen
(
$account
[
'account_no'
]);
dump
(
$accountNo
);
}
}
}
}
}
}
...
...
app/Http/Services/SupplierReceiptService.php
View file @
e77eb752
...
@@ -14,4 +14,8 @@ class SupplierReceiptService
...
@@ -14,4 +14,8 @@ class SupplierReceiptService
public
static
function
isOnlyDigitsAndHyphen
(
$str
)
{
public
static
function
isOnlyDigitsAndHyphen
(
$str
)
{
return
preg_match
(
"/^[0-9\-]*$/"
,
$str
);
return
preg_match
(
"/^[0-9\-]*$/"
,
$str
);
}
}
public
static
function
keepOnlyDigitsAndHyphen
(
$str
)
{
return
preg_replace
(
"/[^0-9\-]/"
,
""
,
$str
);
}
}
}
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