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
ab387899
authored
Sep 05, 2024
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复数据
parent
012e9ec9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletions
app/Http/Services/DealImageService.php
app/Http/routes.php
app/Http/Services/DealImageService.php
View file @
ab387899
...
...
@@ -9,6 +9,7 @@ use App\Model\SupplierBlacklistModel;
use
App\Model\SupplierChannelModel
;
use
http\Exception\InvalidArgumentException
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Support\Str
;
//处理多个系统的图片替换问题
class
DealImageService
...
...
@@ -113,6 +114,24 @@ class DealImageService
}
}
public
static
function
replaceCmsImage
()
{
$bcatIdList
=
DB
::
connection
(
'mysql'
)
->
table
(
'lie_base_cat'
)
->
where
(
'bcat_name'
,
'like'
,
"%爱智%"
)
->
pluck
(
'bcat_id'
);
$baseList
=
DB
::
connection
(
'mysql'
)
->
table
(
'lie_base'
)
->
whereIn
(
'bcat_id'
,
$bcatIdList
)
->
where
(
'images'
,
'!='
,
''
)
->
limit
(
1000
)
->
get
();
foreach
(
$baseList
as
$base
)
{
if
(
strpos
(
$base
[
'images'
],
'imgscdn.ichunt.com/show/big'
)
!==
false
||
strpos
(
$base
[
'images'
],
'image.liexindev.net/show/big'
)
!==
false
)
{
$base
[
'images'
]
=
str_replace
(
'big'
,
'origin'
,
$base
[
'images'
]);
//回写到数据库
DB
::
connection
(
'mysql'
)
->
table
(
'lie_base'
)
->
where
(
'base_id'
,
$base
[
'base_id'
])
->
update
([
'images'
=>
$base
[
'images'
]
]);
}
dump
(
$base
[
'base_id'
]);
}
}
//处理新闻的缩略图
public
static
function
dealNewsPic
()
{
...
...
app/Http/routes.php
View file @
ab387899
...
...
@@ -84,7 +84,7 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
\App\Http\Services\DealImageService
::
dealNewsPic
();
\App\Http\Services\DealImageService
::
replaceCmsImage
();
//\App\Http\Services\SupplierAddressService::initUnitedAddress();
//\App\Http\Services\DataService::checkSupplierBandAccount();
//(new CompanyService())->checkSupplierCompanyAndAddress(11042);
...
...
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