Commit f31abdef by 杨树贤

fix

parent 6c4a0616
......@@ -1424,4 +1424,34 @@ class DataService
}
}
}
//找出没有yunxin_sku_id但是有采购跟单员的,然后把采购跟单员给去掉
public function fixSupplierContacts()
{
// 查询没有yunxin_sku_id但有采购跟单员的供应商
$suppliers = SupplierChannelModel::whereNull('yunxin_sku_id')
->whereNotNull('channel_uid')
->get();
foreach ($suppliers as $supplier) {
// 获取该供应商的所有采购跟单员
$contacts = SupplierContactModel::where('supplier_id', $supplier->supplier_id)
->where('channel_user_type', 4)
->get();
// 如果有采购跟单员,就删除它们
foreach ($contacts as $contact) {
//如果can_check_uids不在 10009
//判断创建时间是不是2025年1月3日的时间戳之前创建的
//如果是的话,那么就改成普通采购员
if ($contact->add_time < strtotime('2025-01-03')) {
$contact->channel_user_type = 1;
$contact->save();
}else{
// 如果是之后创建的,就删除
$contact->delete();
}
}
}
}
}
......@@ -339,7 +339,7 @@ class SkuService extends BaseService
'sku_id' => $skuId,
'cp_time' => $data['cp_time'],
];
ManualPutawaySkuLog::addManualPutawaySkuLog($skuId, $supplierCodes[$key],1);
ManualPutawaySkuLog::addManualPutawaySkuLog($skuId, $supplierCodes[$key], 1);
}
} else {
foreach ($skuIds as $key => $skuId) {
......@@ -349,6 +349,8 @@ class SkuService extends BaseService
$queueData['down_type'] = 2;
$queueData['data'] = $skuIds;
}
$queueData['source'] = 'supplier';
$queueData['user_id'] = request()->user->userId;
QueueService::publishQueueSecond($queueName, $queueData);
} catch (\Exception $exception) {
return $exception;
......
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