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
eb8191ac
authored
Jul 27, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
中文
parent
55b9e064
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
app/Http/Transformers/SupplierContactTransformer.php
app/Http/Transformers/SupplierContactTransformer.php
View file @
eb8191ac
...
...
@@ -18,30 +18,30 @@ class SupplierContactTransformer
if
(
!
empty
(
$item
[
'supplier_email'
]))
{
$emailTemp
=
explode
(
'@'
,
$item
[
'supplier_email'
])[
0
];
$replace
=
str_pad
(
'*'
,
strlen
(
$emailTemp
),
'*'
);
$emailTemp
=
str_replace
(
$emailTemp
,
$replace
,
$emailTemp
);
$emailTemp
=
mb_
str_replace
(
$emailTemp
,
$replace
,
$emailTemp
);
if
(
count
(
explode
(
'@'
,
$item
[
'supplier_email'
]))
>
1
)
{
$item
[
'supplier_email'
]
=
$emailTemp
.
'@'
.
explode
(
'@'
,
$item
[
'supplier_email'
])[
1
];
}
else
{
$item
[
'supplier_email'
]
=
$emailTemp
;
}
}
if
(
!
empty
(
$item
[
'supplier_mobile'
]))
{
if
(
!
empty
(
$item
[
'supplier_mobile'
])
&&
!
preg_match
(
"/[\x
{
4e00}-\x{9fa5
}
]/u"
,
$item
[
'supplier_mobile'
])
)
{
$temp
=
substr
(
$item
[
'supplier_mobile'
],
3
,
4
);
$item
[
'supplier_mobile'
]
=
str_replace
(
$temp
,
'****'
,
$item
[
'supplier_mobile'
]);
$item
[
'supplier_mobile'
]
=
mb_
str_replace
(
$temp
,
'****'
,
$item
[
'supplier_mobile'
]);
}
if
(
!
empty
(
$item
[
'supplier_qq'
]))
{
$temp
=
substr
(
$item
[
'supplier_qq'
],
2
,
strlen
(
$item
[
'supplier_qq'
]));
$replace
=
str_pad
(
'*'
,
strlen
(
$temp
),
'*'
);
$item
[
'supplier_qq'
]
=
str_replace
(
$temp
,
$replace
,
$item
[
'supplier_qq'
]);
$item
[
'supplier_qq'
]
=
mb_
str_replace
(
$temp
,
$replace
,
$item
[
'supplier_qq'
]);
}
if
(
!
empty
(
$item
[
'supplier_telephone'
]))
{
if
(
count
(
explode
(
'-'
,
$item
[
'supplier_telephone'
]))
>
1
)
{
$temp
=
explode
(
'-'
,
$item
[
'supplier_telephone'
])[
1
];
$replace
=
str_pad
(
'*'
,
strlen
(
$temp
),
'*'
);
$item
[
'supplier_telephone'
]
=
str_replace
(
$temp
,
$replace
,
$item
[
'supplier_telephone'
]);
$item
[
'supplier_telephone'
]
=
mb_
str_replace
(
$temp
,
$replace
,
$item
[
'supplier_telephone'
]);
}
else
{
$replace
=
str_pad
(
'*'
,
strlen
(
$item
[
'supplier_telephone'
]),
'*'
);
$item
[
'supplier_telephone'
]
=
str_replace
(
$item
[
'supplier_telephone'
],
$replace
,
$item
[
'supplier_telephone'
]
=
mb_
str_replace
(
$item
[
'supplier_telephone'
],
$replace
,
$item
[
'supplier_telephone'
]);
}
...
...
@@ -52,4 +52,4 @@ class SupplierContactTransformer
return
$list
;
}
}
\ 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