|
|
|
@ -44,15 +44,15 @@ class ProductServiceProvider extends ServiceProvider |
|
|
|
/** 同步信息到代理商产品 END */ |
|
|
|
|
|
|
|
/** 自动上架 START */ |
|
|
|
$agentIds = Agent::query()->where([ |
|
|
|
Agent::query()->where([ |
|
|
|
['id', '>', 1], //1是总管理员,不处理
|
|
|
|
['type', '<>', AgentType::OPERATOR], |
|
|
|
['status', '=', UserStatus::NORMAL] |
|
|
|
])->pluck('id'); |
|
|
|
|
|
|
|
foreach ($agentIds as $agent_id) { |
|
|
|
AgentProductShelve::dispatch($agent_id, $product->id); |
|
|
|
} |
|
|
|
])->select(['id'])->chunk(100, function ($agents) use ($product) { |
|
|
|
foreach ($agents as $agent) { |
|
|
|
AgentProductShelve::dispatch($agent['id'], $product->id); |
|
|
|
} |
|
|
|
}); |
|
|
|
/** 自动上架 END */ |
|
|
|
} |
|
|
|
}); |
|
|
|
|