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
b2f9b3ac
authored
Jun 05, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复批量设置的问题
parent
689b4dd5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
app/Http/Services/DataService.php
app/Http/Services/SkuService.php
app/Http/Services/DataService.php
View file @
b2f9b3ac
...
...
@@ -1217,7 +1217,7 @@ class DataService
}
else
{
$ruler
[
'upload_allow_brands'
]
=
$mainBrands
;
}
dump
(
$ruler
);
dump
(
$
supplier
[
'supplier_id'
],
$
ruler
);
$redis
->
hset
(
'supplier_sku_upload_ruler_v2'
,
$supplier
[
'supplier_id'
],
json_encode
(
$ruler
));
}
}
...
...
app/Http/Services/SkuService.php
View file @
b2f9b3ac
...
...
@@ -363,10 +363,11 @@ class SkuService
if
(
$setType
==
1
)
{
$supplierIds
=
SupplierChannelModel
::
where
(
'supplier_group'
,
$supplierGroup
)
->
where
(
'is_type'
,
0
)
->
pluck
(
'supplier_id'
)
->
toArray
();
$supplierIds
=
collect
(
$supplierIds
)
->
chunk
(
30
0
)
->
toArray
();
$supplierIds
=
collect
(
$supplierIds
)
->
chunk
(
5
0
)
->
toArray
();
foreach
(
$supplierIds
as
$supplierIdList
)
{
$supplierIdList
=
array_values
(
$supplierIdList
);
//先去批量设置过期时间限制天数
SupplierChannelModel
::
whereIn
(
'supplier_id'
,
$supplierIdList
)
->
update
([
$result
=
SupplierChannelModel
::
whereIn
(
'supplier_id'
,
$supplierIdList
)
->
update
([
'cp_time_day'
=>
$cpTimeDay
]);
foreach
(
$supplierIdList
as
$supplierId
)
{
...
...
@@ -382,8 +383,8 @@ class SkuService
$redis
->
hset
(
'supplier_sku_upload_ruler_v2'
,
$supplierId
,
$ruler
);
}
$cpTimeDay
=
$cpTimeDay
==
-
1
?
'无限制'
:
$cpTimeDay
;
(
new
LogService
())
->
BatchAddIgnoreAuditLogs
(
$supplierIdList
,
LogModel
::
UPDATE_OPERATE
,
'批量配置供应商sku上架有效期'
,
'上架有效期修改为'
.
$cpTimeDay
.
'天'
);
$cpTimeDay
Str
=
$cpTimeDay
==
-
1
?
'无限制'
:
$cpTimeDay
;
(
new
LogService
())
->
BatchAddIgnoreAuditLogs
(
$supplierIdList
,
LogModel
::
UPDATE_OPERATE
,
'批量配置供应商sku上架有效期'
,
'上架有效期修改为'
.
$cpTimeDay
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