Commit b2f9b3ac by 杨树贤

修复批量设置的问题

parent 689b4dd5
...@@ -1217,7 +1217,7 @@ class DataService ...@@ -1217,7 +1217,7 @@ class DataService
} else { } else {
$ruler['upload_allow_brands'] = $mainBrands; $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)); $redis->hset('supplier_sku_upload_ruler_v2', $supplier['supplier_id'], json_encode($ruler));
} }
} }
......
...@@ -363,10 +363,11 @@ class SkuService ...@@ -363,10 +363,11 @@ class SkuService
if ($setType == 1) { if ($setType == 1) {
$supplierIds = SupplierChannelModel::where('supplier_group', $supplierGroup)->where('is_type', 0) $supplierIds = SupplierChannelModel::where('supplier_group', $supplierGroup)->where('is_type', 0)
->pluck('supplier_id')->toArray(); ->pluck('supplier_id')->toArray();
$supplierIds = collect($supplierIds)->chunk(300)->toArray(); $supplierIds = collect($supplierIds)->chunk(50)->toArray();
foreach ($supplierIds as $supplierIdList) { 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 'cp_time_day' => $cpTimeDay
]); ]);
foreach ($supplierIdList as $supplierId) { foreach ($supplierIdList as $supplierId) {
...@@ -382,8 +383,8 @@ class SkuService ...@@ -382,8 +383,8 @@ class SkuService
$redis->hset('supplier_sku_upload_ruler_v2', $supplierId, $ruler); $redis->hset('supplier_sku_upload_ruler_v2', $supplierId, $ruler);
} }
$cpTimeDay = $cpTimeDay == -1 ? '无限制' : $cpTimeDay; $cpTimeDayStr = $cpTimeDay == -1 ? '无限制' : $cpTimeDay;
(new LogService())->BatchAddIgnoreAuditLogs($supplierIdList, LogModel::UPDATE_OPERATE, '批量配置供应商sku上架有效期', '上架有效期修改为' . $cpTimeDay . '天'); (new LogService())->BatchAddIgnoreAuditLogs($supplierIdList, LogModel::UPDATE_OPERATE, '批量配置供应商sku上架有效期', '上架有效期修改为' . $cpTimeDayStr . '天');
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment