Merge branch 'hotfix/allocation' into develop
This commit is contained in:
@@ -529,14 +529,16 @@ class CustomerService
|
|||||||
$uidRotator = new \app\common\utils\RedisUidRotator('allocation_customer_user');
|
$uidRotator = new \app\common\utils\RedisUidRotator('allocation_customer_user');
|
||||||
$uidRotator->setUids($userId, false);
|
$uidRotator->setUids($userId, false);
|
||||||
|
|
||||||
Customer::whereIn('user_id',$resignUerIds)->chunk(500, function ($customers) use ($uidRotator){
|
Customer::whereIn('user_id', $resignUerIds)
|
||||||
foreach ($customers as $customer) {
|
->orderBy('id', 'asc')
|
||||||
// 获取下一个分配的UID
|
->chunkById(500, function ($customers) use ($uidRotator) {
|
||||||
$newUserId = $uidRotator->next();
|
foreach ($customers as $customer) {
|
||||||
$customer->user_id = $newUserId;
|
// 获取下一个分配的UID
|
||||||
$customer->save();
|
$newUserId = $uidRotator->next();
|
||||||
}
|
$customer->user_id = $newUserId;
|
||||||
});
|
$customer->save();
|
||||||
|
}
|
||||||
|
}, 'id');
|
||||||
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|||||||
Reference in New Issue
Block a user