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
29992d45
authored
Sep 04, 2024
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
添加任务
parent
43ac922f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
app/Console/Commands/SetSupplierFollowUp.php
app/Http/Services/DealImageService.php
app/Http/routes.php
app/Console/Commands/SetSupplierFollowUp.php
View file @
29992d45
...
...
@@ -33,7 +33,7 @@ class SetSupplierFollowUp extends Command
public
function
handle
()
{
//DealImageService::dealNewsImage();
DealImageService
::
deal
Cm
sImage
();
DealImageService
::
deal
New
sImage
();
//DealImageService::dealSkuDetailAndImage();
}
}
app/Http/Services/DealImageService.php
View file @
29992d45
...
...
@@ -42,7 +42,7 @@ class DealImageService
//先去处理芯媒体的图片链接
public
static
function
dealNewsImage
()
{
$newsList
=
DB
::
connection
(
'liexin'
)
->
table
(
'article'
)
->
where
(
'deal_status'
,
'!='
,
1
)
->
orderBy
(
'art_id'
,
'desc'
)
->
limit
(
1
00
)
->
get
();
$newsList
=
DB
::
connection
(
'liexin'
)
->
table
(
'article'
)
->
orderBy
(
'art_id'
,
'desc'
)
->
limit
(
10
00
)
->
get
();
$redis
=
new
RedisModel
();
foreach
(
$newsList
as
$news
)
{
$addon
=
DB
::
connection
(
'liexin'
)
->
table
(
'article_addon'
)
->
where
(
'art_id'
,
$news
[
'art_id'
])
->
first
();
...
...
@@ -74,9 +74,9 @@ class DealImageService
'body'
=>
$news
[
'body'
],
]);
DB
::
connection
(
'liexin'
)
->
table
(
'article'
)
->
where
(
'art_id'
,
$news
[
'art_id'
])
->
update
([
'deal_status'
=>
1
,
]);
//
DB::connection('liexin')->table('article')->where('art_id', $news['art_id'])->update([
//
'deal_status' => 1,
//
]);
dump
(
'处理文章id : '
.
$news
[
'art_id'
]);
...
...
@@ -91,6 +91,7 @@ class DealImageService
//先去找出所有带有图片的cms数据
$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
)
{
$imageUrl
=
self
::
checkImage
(
$base
[
'images'
]);
if
(
empty
(
$imageUrl
))
{
...
...
@@ -104,6 +105,7 @@ class DealImageService
foreach
(
$imageMap
as
$originImage
=>
$newImage
)
{
$base
[
'images'
]
=
str_replace
(
$originImage
,
$newImage
,
$base
[
'images'
]);
}
dump
(
$base
[
'base_id'
]);
//回写到数据库
DB
::
connection
(
'mysql'
)
->
table
(
'lie_base'
)
->
where
(
'base_id'
,
$base
[
'base_id'
])
->
update
([
'images'
=>
$base
[
'images'
]
...
...
app/Http/routes.php
View file @
29992d45
...
...
@@ -84,7 +84,7 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
\App\Http\Services\DealImageService
::
deal
Cm
sImage
();
\App\Http\Services\DealImageService
::
deal
New
sImage
();
//\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