Commit 72f63409 by 杨树贤

脚本

parent 34f41845
Showing with 6 additions and 3 deletions
......@@ -1600,7 +1600,11 @@ class DataService
//初始化sku的规则
public function initFuturesSkuUploadRuler()
{
$suppliers = SupplierChannelModel::where('sku_upload_ruler', '!=', '')->get()->toArray();
$suppliers = SupplierChannelModel::where('sku_upload_ruler', '!=', '')->select([
'sku_upload_ruler',
'supplier_id'
])->get()->toArray();
$redis = new RedisModel();
foreach ($suppliers as $supplier) {
$uploadRuler = $supplier['sku_upload_ruler'];
$uploadRuler = json_decode($uploadRuler, true);
......@@ -1611,8 +1615,7 @@ class DataService
SupplierChannelModel::where('supplier_id',$supplier['supplier_id'])->update([
'sku_upload_ruler' => $uploadRuler,
]);
(new SupplierService())->saveSkuUploadRulerToRedis($supplier['supplier_id'],$uploadRuler);
$redis->hset('supplier_sku_upload_ruler', $supplier['supplier_id'], $uploadRuler);
}
}
......
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